File tree 1 file changed +5
-6
lines changed
packages/storage/src/implementation
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,15 @@ export class FirebaseStorageError extends FirebaseError {
27
27
*/
28
28
customData : { serverResponse : string | null } = { serverResponse : null } ;
29
29
30
+ private readonly baseMessage : string ;
30
31
/**
31
32
* @param code - A StorageErrorCode string to be prefixed with 'storage/' and
32
33
* added to the end of the message.
33
34
* @param message - Error message.
34
35
*/
35
36
constructor ( code : StorageErrorCode , message : string ) {
36
- super (
37
- prependCode ( code ) ,
38
- `Firebase Storage: ${ message } (${ prependCode ( code ) } )`
39
- ) ;
37
+ super ( prependCode ( code ) , '' /* unused error message */ ) ;
38
+ this . baseMessage = `Firebase Storage: ${ message } (${ prependCode ( code ) } )` ;
40
39
// Without this, `instanceof FirebaseStorageError`, in tests for example,
41
40
// returns false.
42
41
Object . setPrototypeOf ( this , FirebaseStorageError . prototype ) ;
@@ -54,9 +53,9 @@ export class FirebaseStorageError extends FirebaseError {
54
53
*/
55
54
get message ( ) : string {
56
55
if ( this . customData . serverResponse ) {
57
- return `${ this . message } \n${ this . customData . serverResponse } ` ;
56
+ return `${ this . baseMessage } \n${ this . customData . serverResponse } ` ;
58
57
} else {
59
- return this . message ;
58
+ return this . baseMessage ;
60
59
}
61
60
}
62
61
You can’t perform that action at this time.
0 commit comments