diff --git a/src/utils/error.ts b/src/utils/error.ts index 721614dc36..986a4e6770 100644 --- a/src/utils/error.ts +++ b/src/utils/error.ts @@ -484,6 +484,10 @@ export class MessagingClientErrorCode { message: 'The rate of messages to subscribers to a particular topic is too high. Reduce the ' + 'number of messages sent for this topic, and do not immediately retry sending to this topic.', }; + public static MESSAGE_RATE_EXCEEDED = { + code: 'message-rate-exceeded', + message: 'Sending limit exceeded for the message target.', + }; public static INVALID_APNS_CREDENTIALS = { code: 'invalid-apns-credentials', message: 'A message targeted to an iOS device could not be sent because the required APNs ' + @@ -610,14 +614,14 @@ const MESSAGING_SERVER_TO_CLIENT_CODE: ServerToClientCode = { InvalidApnsCredential: 'INVALID_APNS_CREDENTIALS', /* FCM new server API error codes */ - NOT_FOUND: 'REGISTRATION_TOKEN_NOT_REGISTERED', + UNREGISTERED: 'REGISTRATION_TOKEN_NOT_REGISTERED', INVALID_ARGUMENT: 'INVALID_ARGUMENT', - RESOURCE_EXHAUSTED: 'TOO_MANY_TOPICS', - PERMISSION_DENIED: 'AUTHENTICATION_ERROR', - UNAUTHENTICATED: 'AUTHENTICATION_ERROR', + QUOTA_EXCEEDED: 'MESSAGE_RATE_EXCEEDED', + SENDER_ID_MISMATCH: 'MISMATCHED_CREDENTIAL', + APNS_AUTH_ERROR: 'INVALID_APNS_CREDENTIALS', UNAVAILABLE: 'SERVER_UNAVAILABLE', INTERNAL: 'INTERNAL_ERROR', - UNKNOWN: 'UNKNOWN_ERROR', + UNSPECIFIED_ERROR: 'UNKNOWN_ERROR', }; /** @const {ServerToClientCode} Topic management (IID) server to client enum error codes. */