Call callback whe json_decode error.

This commit is contained in:
sc0Vu 2017-12-15 12:46:38 +08:00
parent 8738aa8de1
commit c1ac5f4205

View File

@ -67,7 +67,7 @@ class HttpRequestManager extends RequestManager implements IRequestManager
$json = json_decode($res->getBody()); $json = json_decode($res->getBody());
if (JSON_ERROR_NONE !== json_last_error()) { if (JSON_ERROR_NONE !== json_last_error()) {
throw new \InvalidArgumentException('json_decode error: ' . json_last_error_msg()); return call_user_func($callback, new \InvalidArgumentException('json_decode error: ' . json_last_error_msg()), null);
} }
call_user_func($callback, null, $json); call_user_func($callback, null, $json);