Skip to content

Commit

Permalink
Merge pull request #43 from quitoque/master
Browse files Browse the repository at this point in the history
 Throw a ServerException instead of Fatal when the server response is invalid
  • Loading branch information
tim-bezhashvyly committed Mar 5, 2018
2 parents f7bfe4a + 40fa6f2 commit 6f630da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Snowcap/Emarsys/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,10 @@ protected function send($method = 'GET', $uri, array $body = array())
}
}

if (is_array($responseArray) === false) {
throw new ServerException("JSON response is not an array:\n" . $responseArray);
}

return new Response($responseArray);
}

Expand Down

0 comments on commit 6f630da

Please sign in to comment.