Skip to content

fix(google): recover provider errors from HTTPError; valid Drive field mask - #37

Merged
alexeygrigorev merged 1 commit into
mainfrom
dapier-wt-gmail-gdrive-1104
Nov 4, 2026
Merged

alexeygrigorev merged 1 commit into
mainfrom
dapier-wt-gmail-gdrive-1104

Conversation

@alexeygrigorev

Copy link
Copy Markdown
Member

Live verification of the Google CLIs exposed two defects:

  1. Invalid field mask: FILE_FIELDS named extension, which Drive rejects with 400 Invalid field selection — the field is fileExtension.
  2. Opaque provider errors: urllib's transport raises HTTPError on non-2xx, and discovery._request folded every exception into provider request unreachable: HTTPError, losing the status and the provider's message (and with it the 403 scope hints). _request now recovers the HTTPError status/body; gdrive's direct-transport paths (multipart upload, download, permanent delete) share one _transport helper with the same recovery. Fake transports returning (status, raw) — the existing tests — are unaffected.

Includes a regression test: an HTTPError(403) from the transport produces a GDriveOpsError with status 403, the provider's message, and the scope hint.

…nvalid Drive field

The live Drive read exposed two defects: FILE_FIELDS named 'extension'
(Drive rejected the listing with 400 Invalid field selection — the field
is 'fileExtension'), and provider 4xx/5xx surfaced as 'provider request
unreachable: HTTPError' because urllib's transport raises on non-2xx and
discovery._request folded every exception into the type name. _request now
recovers the HTTPError's status/body so provider errors keep their status
and redacted detail (the scope hints fire); gdrive's direct-transport
paths (multipart upload, download, permanent delete) share one _transport
helper with the same recovery. Fake transports returning (status, raw)
are unaffected.
@alexeygrigorev
alexeygrigorev merged commit 7f5220b into main Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant