Google API Core Client - Class ApiException (1.35.1)

Reference documentation and code samples for the Google API Core Client class ApiException.

Represents an exception thrown during an RPC.

Namespace

Google \ ApiCore

Methods

__construct

ApiException constructor.

Parameters
Name
Description
message
string
code
int
status
string|null
optionalArgs
array

{ @type Exception|null $previous @type array|null $metadata @type string|null $basicMessage }

↳ previous
Exception|null
↳ metadata
array|null
↳ basicMessage
string|null

getStatus

getReason

Returns the reason in ErrorInfo for an exception, or null if there is no ErrorInfo.

Returns
Type
Description
string|null
$reason

getDomain

Returns the domain in ErrorInfo for an exception, or null if there is no ErrorInfo.

Returns
Type
Description
string|null
$domain

Returns the metadata in ErrorInfo for an exception, or null if there is no ErrorInfo.

Returns
Type
Description
array|null
$errorInfoMetadata

getBasicMessage

Returns
Type
Description
null|string
Returns
Type
Description
array

__toString

String representation of ApiException

Returns
Type
Description
string

static::createFromStdClass

Parameter
Name
Description
status
stdClass
Returns
Type
Description

static::createFromApiResponse

Parameters
Name
Description
basicMessage
string
rpcCode
int
metadata
array|null
previous
Exception
Returns
Type
Description

static::createFromRestApiResponse

For REST-based responses, the metadata does not need to be decoded.

Parameters
Name
Description
basicMessage
string
rpcCode
int
metadata
array|null
previous
Exception
Returns
Type
Description

static::createFromRpcStatus

Parameter
Name
Description
Returns
Type
Description

static::createFromRequestException

Creates an ApiException from a GuzzleHttp RequestException.

Parameters
Name
Description
ex
GuzzleHttp\Exception\RequestException
isStream
bool
Returns
Type
Description
Create a Mobile Website
View Site in Mobile | Classic
Share by: