src/Koldy/Route/DefaultRoute.php
public function handleException(Throwable $e): void
    {
        $exceptionHandlerPath = null;

        if (($module = Application::getCurrentModule()) !== null) {
            $exceptionHandlerPath = Application::getModulePath($module) . 'controllers/ExceptionHandler.php';
            if (!is_file($exceptionHandlerPath)) {
                $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
            }
        } else {
            $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
        }

        if (is_file($exceptionHandlerPath)) {
            require_once $exceptionHandlerPath;
            $exceptionHandler = new \ExceptionHandler($e);

            if ($exceptionHandler instanceof ResponseExceptionHandler) {
                $exceptionHandler->exec();
            } else {
                $routeException = new ServerException('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
                Log::emergency($routeException);
                Application::terminateWithError('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
            }
        } else {
            $exceptionHandler = new ResponseExceptionHandler($e);
            $exceptionHandler->exec();
        }
    }
public function handleException(Throwable $e): void
    {
        $exceptionHandlerPath = null;

        if (($module = Application::getCurrentModule()) !== null) {
            $exceptionHandlerPath = Application::getModulePath($module) . 'controllers/ExceptionHandler.php';
            if (!is_file($exceptionHandlerPath)) {
                $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
            }
        } else {
            $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
        }

        if (is_file($exceptionHandlerPath)) {
            require_once $exceptionHandlerPath;
            $exceptionHandler = new \ExceptionHandler($e);

            if ($exceptionHandler instanceof ResponseExceptionHandler) {
                $exceptionHandler->exec();
            } else {
                $routeException = new ServerException('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
                Log::emergency($routeException);
                Application::terminateWithError('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
            }
        } else {
            $exceptionHandler = new ResponseExceptionHandler($e);
            $exceptionHandler->exec();
        }
    }
public function handleException ( Throwable $ e ) : void { $ exceptionHandlerPath = null ; if ( ( $ module = Application :: getCurrentModule ( ) ) !== null ) { $ exceptionHandlerPath = Application :: getModulePath ( $ module ) . 'controllers/ExceptionHandler.php' ; if ( ! is_file ( $ exceptionHandlerPath ) ) { $ exceptionHandlerPath = Application :: getApplicationPath ( 'controllers/ExceptionHandler.php' ) ; } } else { $ exceptionHandlerPath = Application :: getApplicationPath ( 'controllers/ExceptionHandler.php' ) ; } if ( is_file ( $ exceptionHandlerPath ) ) { require_once $ exceptionHandlerPath ; $ exceptionHandler = new \ ExceptionHandler ( $ e ) ; if ( $ exceptionHandler instanceof ResponseExceptionHandler ) { $ exceptionHandler -> exec ( ) ; } else { $ routeException = new ServerException ( 'Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue' ) ; Log :: emergency ( $ routeException ) ; Application :: terminateWithError ( 'Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue' ) ; } } else { $ exceptionHandler = new ResponseExceptionHandler ( $ e ) ; $ exceptionHandler -> exec ( ) ; } }
If your app throws any kind of exception, it will end up here, so, handle it!

@param Throwable $e
If your app throws any kind of exception it will end up here so handle it!