original_string: private function getApiErrorMessage(ResponseInterface $response): string
      {
          try {
              $body = $response->getBody()->getContents();
          } catch (\RuntimeException $re) {
              return '';
          }
  
          if (strpos($body, '"Error"') !== false
              && ($body = json_decode($body, true))
              && array_key_exists('Error', $body)
          ) {
              return $body['Error'];
          }
  
          return '';
      }
code: private function getApiErrorMessage(ResponseInterface $response): string
      {
          try {
              $body = $response->getBody()->getContents();
          } catch (\RuntimeException $re) {
              return '';
          }
  
          if (strpos($body, '"Error"') !== false
              && ($body = json_decode($body, true))
              && array_key_exists('Error', $body)
          ) {
              return $body['Error'];
          }
  
          return '';
      }
code_tokens: private function getApiErrorMessage ( ResponseInterface $ response ) : string { try { $ body = $ response -> getBody ( ) -> getContents ( ) ; } catch ( \ RuntimeException $ re ) { return '' ; } if ( strpos ( $ body , '"Error"' ) !== false && ( $ body = json_decode ( $ body , true ) ) && array_key_exists ( 'Error' , $ body ) ) { return $ body [ 'Error' ] ; } return '' ; }
docstring: Extract error message from response body.
  
  @param ResponseInterface $response
  @return string
docstring_tokens: Extract error message from response body .