https.HttpsError class

An explicit error that can be thrown from a handler to send an error to the client that called the function.

Signature:

exportdeclareclassHttpsErrorextendsError

Extends: Error

Constructors

ConstructorModifiersDescription
(constructor)(code, message, details)Constructs a new instance of theHttpsError class

Properties

PropertyModifiersTypeDescription
codeFunctionsErrorCodeA standard error code that will be returned to the client. This also determines the HTTP status code of the response, as defined in code.proto.
detailsunknownExtra data to be converted to JSON and included in the error response.
httpErrorCodeHttpErrorCodeA wire format representation of a provided error code.

Methods

MethodModifiersDescription
toJSON()Returns a JSON-serializable representation of this object.

https.HttpsError.(constructor)

Constructs a new instance of theHttpsError class

Signature:

constructor(code:FunctionsErrorCode,message:string,details?:unknown);

Parameters

ParameterTypeDescription
codeFunctionsErrorCode
messagestring
detailsunknown

https.HttpsError.code

A standard error code that will be returned to the client. This also determines the HTTP status code of the response, as defined in code.proto.

Signature:

readonlycode:FunctionsErrorCode;

https.HttpsError.details

Extra data to be converted to JSON and included in the error response.

Signature:

readonlydetails:unknown;

https.HttpsError.httpErrorCode

A wire format representation of a provided error code.

Signature:

readonlyhttpErrorCode:HttpErrorCode;

https.HttpsError.toJSON()

Returns a JSON-serializable representation of this object.

Signature:

toJSON():HttpErrorWireFormat;

Returns:

HttpErrorWireFormat

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-04-24 UTC.