@@ -63,16 +63,16 @@ export const ERROR_MAP: ErrorMap<ErrorCode> = {
63
63
[ ErrorCode . AVAILABLE_IN_WINDOW ] :
64
64
'This method is available in a Window context.' ,
65
65
[ ErrorCode . AVAILABLE_IN_SW ] :
66
- 'This method is available in a service worker ' + ' context.',
66
+ 'This method is available in a service worker context.' ,
67
67
[ ErrorCode . SHOULD_BE_INHERITED ] :
68
- 'This method should be overriden by ' + ' extended classes.',
68
+ 'This method should be overriden by extended classes.' ,
69
69
[ ErrorCode . BAD_SENDER_ID ] :
70
70
"Please ensure that 'messagingSenderId' is set " +
71
71
'correctly in the options passed into firebase.initializeApp().' ,
72
72
[ ErrorCode . PERMISSION_DEFAULT ] :
73
- 'The required permissions were not granted and ' + ' dismissed instead.',
73
+ 'The required permissions were not granted and dismissed instead.' ,
74
74
[ ErrorCode . PERMISSION_BLOCKED ] :
75
- 'The required permissions were not granted and ' + ' blocked instead.',
75
+ 'The required permissions were not granted and blocked instead.' ,
76
76
[ ErrorCode . UNSUPPORTED_BROWSER ] :
77
77
"This browser doesn't support the API's " +
78
78
'required to use the firebase SDK.' ,
@@ -81,26 +81,27 @@ export const ERROR_MAP: ErrorMap<ErrorCode> = {
81
81
'We are unable to register the ' +
82
82
'default service worker. {$browserErrorMessage}' ,
83
83
[ ErrorCode . SW_REGISTRATION_EXPECTED ] :
84
- 'A service worker registration was the ' + ' expected input.',
84
+ 'A service worker registration was the expected input.' ,
85
85
[ ErrorCode . GET_SUBSCRIPTION_FAILED ] :
86
86
'There was an error when trying to get ' +
87
87
'any existing Push Subscriptions.' ,
88
88
[ ErrorCode . INVALID_SAVED_TOKEN ] :
89
89
'Unable to access details of the saved token.' ,
90
90
[ ErrorCode . SW_REG_REDUNDANT ] :
91
- 'The service worker being used for push was made ' + ' redundant.',
91
+ 'The service worker being used for push was made redundant.' ,
92
92
[ ErrorCode . TOKEN_SUBSCRIBE_FAILED ] :
93
- 'A problem occured while subscribing the ' + ' user to FCM: {$message }',
93
+ 'A problem occured while subscribing the user to FCM: {$errorInfo }' ,
94
94
[ ErrorCode . TOKEN_SUBSCRIBE_NO_TOKEN ] :
95
- 'FCM returned no token when subscribing ' + ' the user to push.',
95
+ 'FCM returned no token when subscribing the user to push.' ,
96
96
[ ErrorCode . TOKEN_SUBSCRIBE_NO_PUSH_SET ] :
97
- 'FCM returned an invalid response ' + ' when getting an FCM token.',
97
+ 'FCM returned an invalid response when getting an FCM token.' ,
98
98
[ ErrorCode . TOKEN_UNSUBSCRIBE_FAILED ] :
99
- 'A problem occured while unsubscribing the ' + 'user from FCM: {$message}' ,
99
+ 'A problem occured while unsubscribing the ' +
100
+ 'user from FCM: {$errorInfo}' ,
100
101
[ ErrorCode . TOKEN_UPDATE_FAILED ] :
101
- 'A problem occured while updating the ' + ' user from FCM: {$message }',
102
+ 'A problem occured while updating the user from FCM: {$errorInfo }' ,
102
103
[ ErrorCode . TOKEN_UPDATE_NO_TOKEN ] :
103
- 'FCM returned no token when updating ' + ' the user to push.',
104
+ 'FCM returned no token when updating the user to push.' ,
104
105
[ ErrorCode . USE_SW_BEFORE_GET_TOKEN ] :
105
106
'The useServiceWorker() method may only be called once and must be ' +
106
107
'called before calling getToken() to ensure your service worker is used.' ,
@@ -114,13 +115,13 @@ export const ERROR_MAP: ErrorMap<ErrorCode> = {
114
115
'The deletion attempt for service worker ' +
115
116
'scope could not be performed as the scope was not found.' ,
116
117
[ ErrorCode . BG_HANDLER_FUNCTION_EXPECTED ] :
117
- 'The input to ' + ' setBackgroundMessageHandler() must be a function.',
118
+ 'The input to setBackgroundMessageHandler() must be a function.' ,
118
119
[ ErrorCode . NO_WINDOW_CLIENT_TO_MSG ] :
119
- 'An attempt was made to message a ' + ' non-existant window client.',
120
+ 'An attempt was made to message a non-existant window client.' ,
120
121
[ ErrorCode . UNABLE_TO_RESUBSCRIBE ] :
121
122
'There was an error while re-subscribing ' +
122
123
'the FCM token for push messaging. Will have to resubscribe the ' +
123
- 'user on next visit. {$message }' ,
124
+ 'user on next visit. {$errorInfo }' ,
124
125
[ ErrorCode . NO_FCM_TOKEN_FOR_RESUBSCRIBE ] :
125
126
'Could not find an FCM token ' +
126
127
'and as a result, unable to resubscribe. Will have to resubscribe the ' +
@@ -139,7 +140,7 @@ export const ERROR_MAP: ErrorMap<ErrorCode> = {
139
140
[ ErrorCode . BAD_VAPID_KEY ] :
140
141
'The public VAPID key is not a Uint8Array with 65 bytes.' ,
141
142
[ ErrorCode . BAD_SUBSCRIPTION ] :
142
- 'The subscription must be a valid ' + ' PushSubscription.',
143
+ 'The subscription must be a valid PushSubscription.' ,
143
144
[ ErrorCode . BAD_TOKEN ] :
144
145
'The FCM Token used for storage / lookup was not ' +
145
146
'a valid token string.' ,
@@ -153,7 +154,7 @@ export const ERROR_MAP: ErrorMap<ErrorCode> = {
153
154
'The usePublicVapidKey() method may only be called once and must be ' +
154
155
'called before calling getToken() to ensure your VAPID key is used.' ,
155
156
[ ErrorCode . PUBLIC_KEY_DECRYPTION_FAILED ] :
156
- 'The public VAPID key did not equal ' + ' 65 bytes when decrypted.'
157
+ 'The public VAPID key did not equal 65 bytes when decrypted.'
157
158
} ;
158
159
159
160
export const errorFactory = new ErrorFactory (
0 commit comments