Back to Firebase Js Sdk

StorageError class

docs-devsite/storage.storageerror.md

12.12.12.9 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

StorageError class

An error returned by the Firebase Storage SDK.

<b>Signature:</b>

typescript
export declare class StorageError extends FirebaseError 

<b>Extends:</b> FirebaseError

Constructors

ConstructorModifiersDescription
(constructor)(code, message, status_)Constructs a new instance of the <code>StorageError</code> class

Properties

PropertyModifiersTypeDescription
customData{ serverResponse: string | null; }Stores custom error data unique to the <code>StorageError</code>.
serverResponsenull | stringOptional response message that was added by the server.
statusnumber

Methods

MethodModifiersDescription
_codeEquals(code)Compares a <code>StorageErrorCode</code> against this error's code, filtering out the prefix.

StorageError.(constructor)

Constructs a new instance of the StorageError class

<b>Signature:</b>

typescript
constructor(code: StorageErrorCode, message: string, status_?: number);

Parameters

ParameterTypeDescription
codeStorageErrorCodeA <code>StorageErrorCode</code> string to be prefixed with 'storage/' and added to the end of the message.
messagestringError message.
status_numberCorresponding HTTP Status Code

StorageError.customData

Stores custom error data unique to the StorageError<!-- -->.

<b>Signature:</b>

typescript
customData: {
        serverResponse: string | null;
    };

StorageError.serverResponse

Optional response message that was added by the server.

<b>Signature:</b>

typescript
get serverResponse(): null | string;

set serverResponse(serverResponse: string | null);

StorageError.status

<b>Signature:</b>

typescript
get status(): number;

set status(status: number);

StorageError._codeEquals()

Compares a StorageErrorCode against this error's code, filtering out the prefix.

<b>Signature:</b>

typescript
_codeEquals(code: StorageErrorCode): boolean;

Parameters

ParameterTypeDescription
codeStorageErrorCode

<b>Returns:</b>

boolean