-
Notifications
You must be signed in to change notification settings - Fork 945
Surface transaction errors in browser #2017
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
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.
Nice! This LGTM but I think we can clean up the naming a bit and maybe factor this into a helper.
packages/firestore/src/platform_browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
packages/firestore/src/platform_browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
packages/firestore/src/platform_browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
packages/firestore/src/platform_browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
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.
little more nitting, sorry.
packages/firestore/src/platform_browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
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.
Ship it.
Transactions made via http surface all 400 errors as INVALID_ARGUMENT, when they could also be FAILED_PRECONDITION or OUT_OF_RANGE (code).
When possible, parse the error message to determine if the server returned a more specific error code.