diff --git a/Lib/Exception/UsageException.php b/Lib/Exception/UsageException.php new file mode 100644 index 0000000..af134e6 --- /dev/null +++ b/Lib/Exception/UsageException.php @@ -0,0 +1,5 @@ +func = $params["func"]; unset($params['func']); if (!is_callable(array($this, $this->func))) { - throw new WebException ("CallFunction", "'func' method not available", -3); + throw new UsageException("CallFunction", "'func' method not available", -3); } $rm = new \ReflectionMethod($this, $this->func); @@ -95,10 +95,10 @@ abstract class WebService /* Check the number of arguments. */ if ($nbParams < $nbArgsFix) { - throw new WebException ("CallArgNumber", "you must provide at least " . $nbArgsFix . " arguments", 4); + throw new UsageException("CallArgNumber", "you must provide at least " . $nbArgsFix . " arguments", 4); } if ($nbParams > $nbArgs) { - throw new WebException ("CallArgNumber", "you must provide at most " . $nbArgs . " arguments", 4); + throw new UsageException("CallArgNumber", "you must provide at most " . $nbArgs . " arguments", 4); } $this->log("Calling '".$this->func."'");