66 * @constructor
77 */
88export class JwtError extends Error {
9- constructor ( readonly code : JwtErrorCode , readonly message : string ) {
9+ constructor (
10+ readonly code : JwtErrorCode ,
11+ readonly message : string
12+ ) {
1013 super ( message ) ;
11- ( this as any ) . __proto__ = JwtError . prototype ;
14+ ( this as any ) . __proto__ = JwtError . prototype
1215 }
1316}
1417
@@ -29,7 +32,7 @@ export enum JwtErrorCode {
2932 * App client error codes and their default messages.
3033 */
3134export class AppErrorCodes {
32- public static INVALID_CREDENTIAL = 'invalid-credential' ;
35+ public static INVALID_CREDENTIAL = 'invalid-credential'
3336}
3437
3538/**
@@ -39,31 +42,31 @@ export class AuthClientErrorCode {
3942 public static INVALID_ARGUMENT = {
4043 code : 'argument-error' ,
4144 message : 'Invalid argument provided.' ,
42- } ;
45+ }
4346 public static INVALID_CREDENTIAL = {
4447 code : 'invalid-credential' ,
4548 message : 'Invalid credential object provided.' ,
46- } ;
49+ }
4750 public static ID_TOKEN_EXPIRED = {
4851 code : 'id-token-expired' ,
4952 message : 'The provided Firebase ID token is expired.' ,
50- } ;
53+ }
5154 public static ID_TOKEN_REVOKED = {
5255 code : 'id-token-revoked' ,
5356 message : 'The Firebase ID token has been revoked.' ,
54- } ;
57+ }
5558 public static INTERNAL_ERROR = {
5659 code : 'internal-error' ,
5760 message : 'An internal error has occurred.' ,
58- } ;
61+ }
5962 public static USER_NOT_FOUND = {
6063 code : 'user-not-found' ,
6164 message : 'There is no user record corresponding to the provided identifier.' ,
62- } ;
65+ }
6366 public static USER_DISABLED = {
6467 code : 'user-disabled' ,
6568 message : 'The user record is disabled.' ,
66- } ;
69+ }
6770}
6871
6972/**
@@ -121,25 +124,25 @@ export class FirebaseError extends Error implements FirebaseErrorInterface {
121124 // Set the prototype explicitly. See the following link for more details:
122125 // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
123126 /* tslint:enable:max-line-length */
124- ( this as any ) . __proto__ = FirebaseError . prototype ;
127+ ( this as any ) . __proto__ = FirebaseError . prototype
125128 }
126129
127130 /** @returns The error code. */
128131 public get code ( ) : string {
129- return this . errorInfo . code ;
132+ return this . errorInfo . code
130133 }
131134
132135 /** @returns The error message. */
133136 public get message ( ) : string {
134- return this . errorInfo . message ;
137+ return this . errorInfo . message
135138 }
136139
137140 /** @returns The object representation of the error. */
138141 public toJSON ( ) : object {
139142 return {
140143 code : this . code ,
141144 message : this . message ,
142- } ;
145+ }
143146 }
144147}
145148
@@ -160,7 +163,11 @@ export interface ErrorInfo {
160163 * @constructor
161164 */
162165export class PrefixedFirebaseError extends FirebaseError {
163- constructor ( private codePrefix : string , code : string , message : string ) {
166+ constructor (
167+ private codePrefix : string ,
168+ code : string ,
169+ message : string
170+ ) {
164171 super ( {
165172 code : `${ codePrefix } /${ code } ` ,
166173 message,
@@ -170,7 +177,7 @@ export class PrefixedFirebaseError extends FirebaseError {
170177 // Set the prototype explicitly. See the following link for more details:
171178 // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
172179 /* tslint:enable:max-line-length */
173- ( this as any ) . __proto__ = PrefixedFirebaseError . prototype ;
180+ ( this as any ) . __proto__ = PrefixedFirebaseError . prototype
174181 }
175182
176183 /**
@@ -181,7 +188,7 @@ export class PrefixedFirebaseError extends FirebaseError {
181188 * @returns True if the code matches, false otherwise.
182189 */
183190 public hasCode ( code : string ) : boolean {
184- return `${ this . codePrefix } /${ code } ` === this . code ;
191+ return `${ this . codePrefix } /${ code } ` === this . code
185192 }
186193}
187194
@@ -202,6 +209,6 @@ export class FirebaseAuthError extends PrefixedFirebaseError {
202209 // Set the prototype explicitly. See the following link for more details:
203210 // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
204211 /* tslint:enable:max-line-length */
205- ( this as any ) . __proto__ = FirebaseAuthError . prototype ;
212+ ( this as any ) . __proto__ = FirebaseAuthError . prototype
206213 }
207214}
0 commit comments