-
Notifications
You must be signed in to change notification settings - Fork 928
Add public FunctionsErrorCode type #6344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 7664c1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (930,087 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for you, thanks!
@@ -72,6 +72,30 @@ export interface Functions { | |||
customDomain: string | null; | |||
} | |||
|
|||
/** | |||
* Functions error code string before adding "functions/" product prefix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it sound like the strings come before the prefix -- is that right?
Also, why specifically "product prefix?" Would that mean something like "functions/firestore?"
If we have a staged version of this, that could help me grok it I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staging it won't add anything that isn't here, unfortunately. Users were reporting that in v8, error codes were coming back as, for example, "deadline-exceeded" (one of the possible strings here) and in v9 they are coming back (more correctly) as "functions/deadline-exceeded" (since this is the functions package). We try to put a prefix with the SDK package name and a "/" before every error thrown by that SDK package. So Firestore should be throwing errors with code "firestore/something", auth should be throwing errors with code "auth/something", etc.
Lines 99-132 below have the main documentation for this code since that's the actual error code (with the prefix added) that users will see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
So yes, if this is how it works, I'd expect something more like "* Functions error code string following the "functions/" product prefix."
or maybe "* Functions error code string appended after "functions/" product prefix."
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I've changed it to "appended after".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add a public
FunctionsErrorCode
type that is prefixed with "functions/" to match the exact strings found inFunctionsError.Code
.This uses template literal types which were introduced in Typescript 4.1. This should be ok for most users I hope? 4.1 was released in Nov 2020.
Fixes #6281