InvalidArgumentException
This commit is contained in:
parent
e238a3596e
commit
08146f97d8
@ -39,7 +39,7 @@ class HttpRequestManager extends RequestManager implements IRequestManager
|
||||
public function sendPayload($payload, $callback)
|
||||
{
|
||||
if (!is_string($payload)) {
|
||||
throw new \RuntimeException('Payload must be string.');
|
||||
throw new \InvalidArgumentException('Payload must be string.');
|
||||
}
|
||||
// $promise = $this->client->postAsync($this->host, [
|
||||
// 'headers' => [
|
||||
@ -67,8 +67,7 @@ class HttpRequestManager extends RequestManager implements IRequestManager
|
||||
$json = json_decode($res->getBody());
|
||||
|
||||
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||
throw new \InvalidArgumentException(
|
||||
'json_decode error: ' . json_last_error_msg());
|
||||
throw new \InvalidArgumentException('json_decode error: ' . json_last_error_msg());
|
||||
}
|
||||
|
||||
call_user_func($callback, null, $json);
|
||||
|
@ -68,7 +68,7 @@ class Web3
|
||||
$callback = array_pop($arguments);
|
||||
|
||||
if (is_callable($callback) !== true) {
|
||||
throw new \RuntimeException('The last param must be callback function.');
|
||||
throw new \InvalidArgumentException('The last param must be callback function.');
|
||||
}
|
||||
$this->provider->send($method, $arguments, $callback);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user