Represents an exception thrown during an RPC.
- Extends
Exception - Implements
Stringable Throwable
| Methods |
| public __construct(string $message, int $code, ?string $status = NULL, array $optionalArgs = []) ApiException constructor.
|
| public __toString() : string String representation of ApiException
|
public static createFromApiResponse( $basicMessage, $rpcCode, ?array $metadata = NULL, ?Exception $previous = NULL)
|
| public static createFromRequestException(GuzzleHttp Creates an ApiException from a GuzzleHttp RequestException.
|
| public static createFromRestApiResponse( $basicMessage, $rpcCode, ?array $metadata = NULL, ?Exception $previous = NULL) For REST-based responses, the metadata does not need to be decoded.
|
public static createFromRpcStatus(Google
|
public static createFromStdClass(stdClass $status)
|
public getBasicMessage()
|
| public getDomain() Returns the
|
| public getErrorInfoMetadata() Returns the
|
public getMetadata()
|
| public getReason() Returns the
|
| public getStatus() |
| Properties |
| Properties |
| private $basicMessage = NULL |
| private $decodedMetadataErrorInfo = NULL |
| private $metadata = NULL |
| private $status = NULL |
| Methods |
| private static containsErrorInfo(array $decodedMetadata) Checks if decoded metadata includes errorInfo message. If errorInfo is set, it will always contain
|
| private static create(string $basicMessage, int $rpcCode, $metadata, array $decodedMetadata, ?Exception $previous = NULL) Construct an ApiException with a useful message, including decoded metadata. If the decoded metadata includes an errorInfo message, then the domain, reason, and metadata fields from that message are hoisted directly into the error.
|
| private static decodeMetadataErrorInfo(array $metadata) Returns null if metadata does not contain error info, or returns containsErrorInfo() array if the metadata does contain error info.
|
| Methods |
| private static containsErrorInfo(array $decodedMetadata) Checks if decoded metadata includes errorInfo message. If errorInfo is set, it will always contain
|
| private static create(string $basicMessage, int $rpcCode, $metadata, array $decodedMetadata, ?Exception $previous = NULL) Construct an ApiException with a useful message, including decoded metadata. If the decoded metadata includes an errorInfo message, then the domain, reason, and metadata fields from that message are hoisted directly into the error.
|
public static createFromApiResponse( $basicMessage, $rpcCode, ?array $metadata = NULL, ?Exception $previous = NULL)
|
| public static createFromRequestException(GuzzleHttp Creates an ApiException from a GuzzleHttp RequestException.
|
| public static createFromRestApiResponse( $basicMessage, $rpcCode, ?array $metadata = NULL, ?Exception $previous = NULL) For REST-based responses, the metadata does not need to be decoded.
|
public static createFromRpcStatus(Google
|
public static createFromStdClass(stdClass $status)
|
| private static decodeMetadataErrorInfo(array $metadata) Returns null if metadata does not contain error info, or returns containsErrorInfo() array if the metadata does contain error info.
|