diff --git a/src/Eth.php b/src/Eth.php index 9564032..d6c337c 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -365,7 +365,7 @@ class Eth public function __call($name, $arguments) { if (empty($this->provider)) { - return; + throw new \RuntimeException('Please set provider first.'); } $class = explode('\\', get_class()); diff --git a/src/Net.php b/src/Net.php index 7f4b164..cf74d00 100644 --- a/src/Net.php +++ b/src/Net.php @@ -64,7 +64,7 @@ class Net public function __call($name, $arguments) { if (empty($this->provider)) { - return; + throw new \RuntimeException('Please set provider first.'); } $class = explode('\\', get_class()); diff --git a/src/Web3.php b/src/Web3.php index ef844e0..1d49c9c 100644 --- a/src/Web3.php +++ b/src/Web3.php @@ -86,7 +86,7 @@ class Web3 public function __call($name, $arguments) { if (empty($this->provider)) { - return; + throw new \RuntimeException('Please set provider first.'); } $class = explode('\\', get_class());