src/Horizon/Exception/HorizonException.php
public static function fromRawResponse($requestedUrl, $httpMethod, $raw, ClientException $clientException = null)
    {
        $title = isset($raw['title']) ? $raw['title'] : 'Unknown Exception';

        $exception = new HorizonException($title, $clientException);
        $exception->title = $title;
        $exception->requestedUrl = $requestedUrl;
        $exception->httpMethod = $httpMethod;

        if (isset($raw['type'])) $exception->type = $raw['type'];
        if (isset($raw['status'])) $exception->httpStatusCode = $raw['status'];
        if (isset($raw['detail'])) $exception->detail = $raw['detail'];
        if (!empty($raw['extras']['result_codes']['operations'])) {
            $exception->operationResultCodes = $raw['extras']['result_codes']['operations'];
        }
        if (!empty($raw['extras']['result_codes']['transaction'])) {
            $exception->transactionResultCode = $raw['extras']['result_codes']['transaction'];
        }

        // Message can contain better info after we've filled out more fields
        $exception->message = $exception->buildMessage();

        $exception->raw = $raw;
        $exception->clientException = $clientException;

        return $exception;
    }
public static function fromRawResponse($requestedUrl, $httpMethod, $raw, ClientException $clientException = null)
    {
        $title = isset($raw['title']) ? $raw['title'] : 'Unknown Exception';

        $exception = new HorizonException($title, $clientException);
        $exception->title = $title;
        $exception->requestedUrl = $requestedUrl;
        $exception->httpMethod = $httpMethod;

        if (isset($raw['type'])) $exception->type = $raw['type'];
        if (isset($raw['status'])) $exception->httpStatusCode = $raw['status'];
        if (isset($raw['detail'])) $exception->detail = $raw['detail'];
        if (!empty($raw['extras']['result_codes']['operations'])) {
            $exception->operationResultCodes = $raw['extras']['result_codes']['operations'];
        }
        if (!empty($raw['extras']['result_codes']['transaction'])) {
            $exception->transactionResultCode = $raw['extras']['result_codes']['transaction'];
        }

        // Message can contain better info after we've filled out more fields
        $exception->message = $exception->buildMessage();

        $exception->raw = $raw;
        $exception->clientException = $clientException;

        return $exception;
    }
NOTE: changes here may requires changes to PostTransactionException::fromHorizonException

@param                 $requestedUrl
@param                 $httpMethod
@param                 $raw
@param ClientException $clientException
@return HorizonException