diff --git a/src/RequestManagers/HttpRequestManager.php b/src/RequestManagers/HttpRequestManager.php index 58028a9..767dd86 100644 --- a/src/RequestManagers/HttpRequestManager.php +++ b/src/RequestManagers/HttpRequestManager.php @@ -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); diff --git a/src/Web3.php b/src/Web3.php index 7aab499..d84b78a 100644 --- a/src/Web3.php +++ b/src/Web3.php @@ -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); }