Custom error type for API errors.
Inheritance
Error > ApiErrorPackage
@google-cloud/commonConstructors
(constructor)(errorMessage)
constructor(errorMessage: string);
Constructs a new instance of the ApiError
class
Parameter | |
---|---|
Name | Description |
errorMessage |
string
|
(constructor)(errorBody)
constructor(errorBody: GoogleErrorBody);
Constructs a new instance of the ApiError
class
Parameter | |
---|---|
Name | Description |
errorBody |
GoogleErrorBody
|
Properties
code
code?: number;
errors
errors?: GoogleInnerError[];
response
response?: r.Response;
Methods
createMultiErrorMessage(err, errors)
static createMultiErrorMessage(err: GoogleErrorBody, errors?: GoogleInnerError[]): string;
Pieces together an error message by combining all unique error messages returned from a single GoogleError
Parameters | |
---|---|
Name | Description |
err |
GoogleErrorBody
The original error. |
errors |
GoogleInnerError[]
Inner errors, if any. |
Returns | |
---|---|
Type | Description |
string | {string} |