getCode() == 0 ? 500 : $exception->getCode(); $logger = Kiri::app()->getLogger(); $logger->write(jTraceEx($exception), 'exception'); return Json::to($code, $exception->getMessage(), [ 'file' => $exception->getFile(), 'line' => $exception->getLine() ]); } /** * @param string $name * @param array $arguments * @return mixed */ public function __call(string $name, array $arguments): mixed { if (!method_exists($this, $name)) { return $this->logger->{$name}(...$arguments); } else { return $this->{$name}(...$arguments); } } }