src/Api/Requester.php
private function createCustomException(ClientException $exception): Exception
    {
        $errorId = '';
        $response = $exception->getResponse();
        if ($response) {
            $data = guzzle_json_decode((string) $response->getBody(), true);
            $errorId = (string) $data['sys']['id'] ?? '';
        }

        $exceptionClass = $this->getExceptionClass($errorId);

        return new $exceptionClass($exception);
    }
private function createCustomException(ClientException $exception): Exception
    {
        $errorId = '';
        $response = $exception->getResponse();
        if ($response) {
            $data = guzzle_json_decode((string) $response->getBody(), true);
            $errorId = (string) $data['sys']['id'] ?? '';
        }

        $exceptionClass = $this->getExceptionClass($errorId);

        return new $exceptionClass($exception);
    }
private function createCustomException ( ClientException $ exception ) : Exception { $ errorId = '' ; $ response = $ exception -> getResponse ( ) ; if ( $ response ) { $ data = guzzle_json_decode ( ( string ) $ response -> getBody ( ) , true ) ; $ errorId = ( string ) $ data [ 'sys' ] [ 'id' ] ?? '' ; } $ exceptionClass = $ this -> getExceptionClass ( $ errorId ) ; return new $ exceptionClass ( $ exception ) ; }
Attempts to create a custom exception.
It will return a default exception if no suitable class is found.

@param ClientException $exception

@return Exception
Attempts to create a custom exception . It will return a default exception if no suitable class is found .