Skip to content
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

Handling FCM Canonical Errors #218

Merged
merged 2 commits into from
Feb 28, 2018
Merged

Handling FCM Canonical Errors #218

merged 2 commits into from
Feb 28, 2018

Conversation

hiranya911
Copy link
Contributor

@hiranya911 hiranya911 commented Feb 27, 2018

The error codes defined in https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode are embedded in the details section of the error response. The top-level error code (status field in the response) may take additional values such as NOT_FOUND and UNAUTHENTICATED (the so called canonical error codes):

{
  "error":{
    "code":404,
    "message":"Requested entity was not found.",
    "status":"NOT_FOUND",
    "details: [
      {
         "@type":"type.googleapis.com/google.firebase.fcm.v1.FcmError",
         "errorCode":"UNREGISTERED"
      }
    ]
  }
}

This PR updates the FCM implementation to handle these additional error codes and map them to correct client-side errors.

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.

2 participants