src/Valkyrja/Http/NativeKernel.php
protected function getExceptionResponse(Throwable $exception): Response
    {
        if ($exception instanceof HttpException && $exception->getResponse() !== null) {
            return $exception->getResponse();
        }

        $handler = new ExceptionHandler($this->app->debug());

        return $handler->getResponse($exception);
    }
protected function getExceptionResponse(Throwable $exception): Response
    {
        if ($exception instanceof HttpException && $exception->getResponse() !== null) {
            return $exception->getResponse();
        }

        $handler = new ExceptionHandler($this->app->debug());

        return $handler->getResponse($exception);
    }
Get a response from an exception.

@param \Throwable $exception The exception

@return \Valkyrja\Http\Response