src/Exception/HttpException.php
public static function wrap(RequestException $e)
    {
        $response = $e->getResponse();

        if ($errors = self::errors($response)) {
            $class = self::exceptionClass($response, $errors[0]);
            $message = implode(', ', array_map('strval', $errors));
        } else {
            $class = self::exceptionClass($response);
            $message = $e->getMessage();
        }

        return new $class($message, $errors, $e->getRequest(), $response, $e);
    }
public static function wrap(RequestException $e)
    {
        $response = $e->getResponse();

        if ($errors = self::errors($response)) {
            $class = self::exceptionClass($response, $errors[0]);
            $message = implode(', ', array_map('strval', $errors));
        } else {
            $class = self::exceptionClass($response);
            $message = $e->getMessage();
        }

        return new $class($message, $errors, $e->getRequest(), $response, $e);
    }
public static function wrap ( RequestException $ e ) { $ response = $ e -> getResponse ( ) ; if ( $ errors = self :: errors ( $ response ) ) { $ class = self :: exceptionClass ( $ response , $ errors [ 0 ] ) ; $ message = implode ( ', ' , array_map ( 'strval' , $ errors ) ) ; } else { $ class = self :: exceptionClass ( $ response ) ; $ message = $ e -> getMessage ( ) ; } return new $ class ( $ message , $ errors , $ e -> getRequest ( ) , $ response , $ e ) ; }
Wraps an API exception in the appropriate domain exception.

@param RequestException $e The API exception

@return HttpException
Wraps an API exception in the appropriate domain exception .