Esempio n. 1
0
 /**
  * Run the processor and exec callback(s)
  *
  * @return mixed
  * @throws Exception
  */
 public function run()
 {
     $callback = $this->registered_method->getCallback();
     $method = $this->registered_method->getMethod();
     set_error_handler(function ($severity, $message, $file, $line) {
         $this->logger->error($message, array("FILE" => $file, "LINE" => $line));
         throw new RpcException('Internal error', -32603);
     });
     try {
         $return = empty($method) ? call_user_func($callback, $this->parameters) : call_user_func(array($callback, $method), $this->parameters);
     } catch (RpcException $re) {
         restore_error_handler();
         throw $re;
     } catch (Exception $e) {
         restore_error_handler();
         $this->logger->error($e->getMessage(), array("FILE" => $e->getFile(), "LINE" => $e->getLine()));
         throw new RpcException('Internal error', -32603);
     }
     restore_error_handler();
     return $return;
 }