Skip to content

Commit

Permalink
fix extracting error message for unhandled api errors
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed May 23, 2015
1 parent edbf4a1 commit 93a46c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/V2/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ protected function request( RequestInterface $request ) {
*/
protected function handleRequestError( RequestInterface $request, ResponseInterface $response ) {
$responseJson = $this->getResponseAsJson( $response );
if( !is_null( $responseJson) && isset( $response->text )) {
$message = $response->text;
if( !is_null( $responseJson) && isset( $responseJson->text )) {
$message = $responseJson->text;
} else {
$message = 'Unknown GW2Api error';
}
Expand Down

0 comments on commit 93a46c3

Please sign in to comment.