ApiException
class ApiException extends Exception (View source)
Represents an exception thrown during an RPC.
Methods
ApiException constructor.
No description
Returns the reason
in ErrorInfo for an exception, or null if there is no ErrorInfo.
Returns the domain
in ErrorInfo for an exception, or null if there is no ErrorInfo.
Returns the metadata
in ErrorInfo for an exception, or null if there is no ErrorInfo.
No description
For REST-based responses, the metadata does not need to be decoded.
No description
Creates an ApiException from a GuzzleHttp RequestException.
No description
No description
String representation of ApiException
Details
__construct(string $message, int $code, string $status = null, array $optionalArgs = [])
ApiException constructor.
getStatus()
No description
string|null
getReason()
Returns the reason
in ErrorInfo for an exception, or null if there is no ErrorInfo.
string|null
getDomain()
Returns the domain
in ErrorInfo for an exception, or null if there is no ErrorInfo.
array|null
getErrorInfoMetadata()
Returns the metadata
in ErrorInfo for an exception, or null if there is no ErrorInfo.
static ApiException
createFromStdClass(stdClass $status)
No description
static ApiException
createFromApiResponse(string $basicMessage, int $rpcCode, array $metadata = null, Exception $previous = null)
No description
static ApiException
createFromRestApiResponse(string $basicMessage, int $rpcCode, array $metadata = null, Exception $previous = null)
For REST-based responses, the metadata does not need to be decoded.
static ApiException
createFromRpcStatus(Status $status)
No description
static ApiException
createFromRequestException(RequestException $ex, bool $isStream = false)
Creates an ApiException from a GuzzleHttp RequestException.
null|string
getBasicMessage()
No description
array
getMetadata()
No description
string
__toString()
String representation of ApiException