src/ApiException.php
private static function create($basicMessage, $rpcCode, $metadata, array $decodedMetadata, $previous = null)
    {
        $rpcStatus = ApiStatus::statusFromRpcCode($rpcCode);
        $messageData = [
            'message' => $basicMessage,
            'code' => $rpcCode,
            'status' => $rpcStatus,
            'details' => $decodedMetadata
        ];

        $message = json_encode($messageData, JSON_PRETTY_PRINT);

        return new ApiException($message, $rpcCode, $rpcStatus, [
            'previous' => $previous,
            'metadata' => $metadata,
            'basicMessage' => $basicMessage,
        ]);
    }
private static function create($basicMessage, $rpcCode, $metadata, array $decodedMetadata, $previous = null)
    {
        $rpcStatus = ApiStatus::statusFromRpcCode($rpcCode);
        $messageData = [
            'message' => $basicMessage,
            'code' => $rpcCode,
            'status' => $rpcStatus,
            'details' => $decodedMetadata
        ];

        $message = json_encode($messageData, JSON_PRETTY_PRINT);

        return new ApiException($message, $rpcCode, $rpcStatus, [
            'previous' => $previous,
            'metadata' => $metadata,
            'basicMessage' => $basicMessage,
        ]);
    }
private static function create ( $ basicMessage , $ rpcCode , $ metadata , array $ decodedMetadata , $ previous = null ) { $ rpcStatus = ApiStatus :: statusFromRpcCode ( $ rpcCode ) ; $ messageData = [ 'message' => $ basicMessage , 'code' => $ rpcCode , 'status' => $ rpcStatus , 'details' => $ decodedMetadata ] ; $ message = json_encode ( $ messageData , JSON_PRETTY_PRINT ) ; return new ApiException ( $ message , $ rpcCode , $ rpcStatus , [ 'previous' => $ previous , 'metadata' => $ metadata , 'basicMessage' => $ basicMessage , ] ) ; }
Construct an ApiException with a useful message, including decoded metadata.

@param string $basicMessage
@param int $rpcCode
@param mixed[]|RepeatedField $metadata
@param array $decodedMetadata
@param \Exception|null $previous
@return ApiException
Construct an ApiException with a useful message including decoded metadata .