InvalidArgumentException

This commit is contained in:
sc0Vu 2017-12-12 16:41:59 +08:00
parent e238a3596e
commit 08146f97d8
2 changed files with 3 additions and 4 deletions

View File

@ -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);

View File

@ -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);
}