Skip to content

Harden Gmail errors with @lowerdeck helpers#43

Open
devdattatalele wants to merge 1 commit into
metorial:mainfrom
devdattatalele:add-gmail-error-helpers
Open

Harden Gmail errors with @lowerdeck helpers#43
devdattatalele wants to merge 1 commit into
metorial:mainfrom
devdattatalele:add-gmail-error-helpers

Conversation

@devdattatalele

Copy link
Copy Markdown

Aligns Gmail with the google-meet/google-analytics/youtube error pattern.

Adds gmail/src/lib/errors.ts with gmailServiceError, gmailApiError, gmailOAuthError. The Api/OAuth helpers use extractGoogleMessage to drill into data.error.errors[].reason, tag data.reason + data.upstreamStatus, and setParent(error) to preserve the upstream stack.

Replaces 20 raw throw new Error(...) across auth.ts + manage-draft / manage-labels / manage-settings / manage-thread with gmailServiceError. Wraps the OAuth callback / refresh / profile-lookup axios calls with try/catch + gmailOAuthError(operation, error) matching the youtube auth shape.

Behavior unchanged on the happy path. Biome clean.

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