Skip to content

Commit 2124d2c

Browse files
BenjaminBenjamin
authored andcommitted
Added json last error code & message on decode failure.
1 parent 11be192 commit 2124d2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Parse/ParseClient.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,11 @@ public static function _request(
495495
$decoded = json_decode($response, true);
496496

497497
if(!isset($decoded) && $response !== '') {
498-
throw new ParseException('Bad Request. Could not decode Response', -1);
498+
throw new ParseException(
499+
'Bad Request. Could not decode Response: '.
500+
'('.json_last_error().') '.json_last_error_msg(),
501+
-1
502+
);
499503

500504
}
501505

0 commit comments

Comments
 (0)