Skip to content

Error handling revamp (v3 release) #334

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

Merged
merged 22 commits into from
Sep 10, 2019
Merged

Error handling revamp (v3 release) #334

merged 22 commits into from
Sep 10, 2019

Conversation

hiranya911
Copy link
Contributor

@hiranya911 hiranya911 commented Aug 27, 2019

Merging the changes made in the error-handling-revamp branch to the master branch.

API CHANGE: Python 2.7 support is now deprecated. Developers are advised to use Python 3.4 or higher to run the Admin SDK.

API CHANGE: Removed old module-level exception types auth.AuthError, db.ApiCallError, messaging.ApiCallError, instance_id.ApiCallError and project_management.ApiCallError.

API CHANGE: Added a new exceptions module that defines base exception types for the entire SDK. Public APIs now raise exceptions defined in the new exceptions module (or subtypes of them). This facilitates implementing fine-grained error handling logic for a wide range of scenarios that was not supported before. See the migration guide for instructions on how to port your existing error handling code.

API CHANGE: change(auth): It is no longer possible to delete user properties with the update_user() API by setting properties to None. Setting properties to None leaves those properties unchanged. They must be explicitly set to auth.DELETE_ATTRIBUTE to delete them.

API CHANGE: change(fcm): The deprecated WebpushFcmOptions type has been removed. Developers must use the PEP8 compliant type name WebpushFCMOptions instead.

API CHANGE: change(Project Management): IosApp, IosAppMetadata and ShaCertificate types in the project_management module have been renamed to IOSApp, IOSAppMetadata and SHACertificate respectively.

RELEASE NOTE: fix: Upgraded google-cloud-firestore dependency version to to 1.14.0.

RELEASE NOTE: fix: Upgraded google-cloud-storage dependency version to 1.18.0.

* Added the exceptions module

* Cleaned up the error handling logic; Added tests

* Updated docs; Fixed some typos
* Migrated FCM send APIs to the new error handling regime

* Moved error parsing logic to _utils

* Refactored OP error handling code

* Fixing a broken test

* Added utils for handling googleapiclient errors

* Added tests for new error handling logic

* Updated public API docs

* Fixing test for python3

* Cleaning up the error code lookup code

* Cleaning up the error parsing APIs

* Cleaned up error parsing logic; Updated docs
* Migrated FCM send APIs to the new error handling regime

* Moved error parsing logic to _utils

* Refactored OP error handling code

* Fixing a broken test

* Added utils for handling googleapiclient errors

* Added tests for new error handling logic

* Updated public API docs

* Fixing test for python3

* Cleaning up the error code lookup code

* Cleaning up the error parsing APIs

* Cleaned up error parsing logic; Updated docs

* Migrated the FCM IID APIs to the new error types
…302)

* Migrated FCM send APIs to the new error handling regime

* Moved error parsing logic to _utils

* Refactored OP error handling code

* Fixing a broken test

* Added utils for handling googleapiclient errors

* Added tests for new error handling logic

* Updated public API docs

* Fixing test for python3

* Cleaning up the error code lookup code

* Cleaning up the error parsing APIs

* Cleaned up error parsing logic; Updated docs

* Migrated the FCM IID APIs to the new error types

* Migrated custom token API to new error types
* Migrated FCM send APIs to the new error handling regime

* Moved error parsing logic to _utils

* Refactored OP error handling code

* Fixing a broken test

* Added utils for handling googleapiclient errors

* Added tests for new error handling logic

* Updated public API docs

* Fixing test for python3

* Cleaning up the error code lookup code

* Cleaning up the error parsing APIs

* Cleaned up error parsing logic; Updated docs

* Migrated the FCM IID APIs to the new error types

* Migrated custom token API to new error types

* Migrated create cookie API to new error types

* Improved error message computation

* Refactored the shared error handling code

* Fixing lint errors

* Renamed variable for clarity
* Added UserNotFoundError type

* Fixed some lint errors

* Some formatting updates

* Updated docs and tests
* New error handling support in create/update/delete user APIs

* Fixing some lint errors
* New error handling support in create/update/delete user APIs

* Fixing some lint errors

* Error handling update in email action link APIs
* Error handling updated for remaining user_mgt APIs

* Removed unused constants
* Migrated token verification APIs to new error types

* Removed old AuthError type

* Added new exception types for revoked tokens
* Migrating db module to new exception types

* Error handling for transactions

* Updated integration tests

* Restoring the old txn abort behavior

* Updated error type in snippet

* Added comment
* Adding some missing error types

* Updated documentation
Copy link

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Hiranya!

@hiranya911 hiranya911 assigned hiranya911 and unassigned egilmorez Aug 30, 2019
@hiranya911 hiranya911 merged commit 9406afe into master Sep 10, 2019
@Dinuz
Copy link

Dinuz commented Sep 12, 2019

@hiranya911 You mentioned to check the migration guide:

See the migration guide for instructions on how to port your existing error handling code.

But unfortunately https://firebase.google.com/docs/admin/migrate-admin#admin_go_sdk_300
doesn't have anything about the python SDK.

Am I looking in the wrong place?

Thanks

@hiranya911
Copy link
Contributor Author

@Dinuz
Copy link

Dinuz commented Sep 13, 2019

@hiranya911 Thank you so very much, that is what I was looking for:)

P.S. The link is one of the first results that pops up in google when you search for firebase admin sdk python migration guide. I know from the link it says go sdk, but when you open it, it has java, go and talks about python (but the content is not there)

@hiranya911
Copy link
Contributor Author

Sorry about that and thanks for bringing it to our attention. Indeed looks like some documentation blunder. I'm working with the docs team to get it resolved asap.

@Dinuz
Copy link

Dinuz commented Sep 13, 2019

@hiranya911 not your fault, and not a problem. I am glad now your team is aware of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants