original_string: protected function resolveExceptionClass(ClientException $exception)
      {
          $response  = $exception->getResponse()->getBody();
          $response  = json_decode($response->getContents());
  
          if ($response === null) {
              return new Exception($exception->getMessage());
          }
  
          $meta  = isset($response->meta) ? $response->meta : $response;
          $class = '\\Larabros\\Elogram\\Exceptions\\'.$meta->error_type;
          return new $class($meta->error_message);
      }
code: protected function resolveExceptionClass(ClientException $exception)
      {
          $response  = $exception->getResponse()->getBody();
          $response  = json_decode($response->getContents());
  
          if ($response === null) {
              return new Exception($exception->getMessage());
          }
  
          $meta  = isset($response->meta) ? $response->meta : $response;
          $class = '\\Larabros\\Elogram\\Exceptions\\'.$meta->error_type;
          return new $class($meta->error_message);
      }
code_tokens: protected function resolveExceptionClass ( ClientException $ exception ) { $ response = $ exception -> getResponse ( ) -> getBody ( ) ; $ response = json_decode ( $ response -> getContents ( ) ) ; if ( $ response === null ) { return new Exception ( $ exception -> getMessage ( ) ) ; } $ meta = isset ( $ response -> meta ) ? $ response -> meta : $ response ; $ class = '\\Larabros\\Elogram\\Exceptions\\' . $ meta -> error_type ; return new $ class ( $ meta -> error_message ) ; }
docstring: Parses a ``ClientException`` for any specific exceptions thrown by the
  API in the response body. If the response body is not in JSON format,
  an ``Exception`` is returned.
  
  Check a ``ClientException`` to see if it has an associated
  ``ResponseInterface`` object.
  
  @param ClientException $exception
  @return Exception
docstring_tokens: Parses a ClientException for any specific exceptions thrown by the API in the response body . If the response body is not in JSON format an Exception is returned .