public function uiRegister() : Closure
  {
    return function($exception, $inspector, $run) {
      $appHandler = new \App\Exceptions\Handler();

      if ($exception instanceof Exception) {
        return $appHandler->render(
          $this->getRequest() ?? new Request(array_merge($_POST, $_FILES)),
          $exception
        );
      }

      Events::trigger('internal.error', [$exception]);
    };
  }