Class ApiError

Custom error type for API errors.

Inheritance

Error > ApiError

Package

@google-cloud/common

Constructors

(constructor)(errorMessage)

constructor(errorMessage: string);

Constructs a new instance of the ApiError class

Parameter
NameDescription
errorMessage string

(constructor)(errorBody)

constructor(errorBody: GoogleErrorBody);

Constructs a new instance of the ApiError class

Parameter
NameDescription
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
NameDescription
err GoogleErrorBody

The original error.

errors GoogleInnerError[]

Inner errors, if any.

Returns
TypeDescription
string

{string}