public function handleException($exception)
    {
        // lets store the exception so we can use the backtrace it provides
        $this->uncaughtException = $exception;
        \http_response_code(500);
        $this->handleError(
            E_ERROR,
            'Uncaught exception \''.\get_class($exception).'\' with message '.$exception->getMessage(),
            $exception->getFile(),
            $exception->getLine()
        );
        $this->uncaughtException = null;
        if ($this->cfg['continueToPrevHandler'] && $this->prevExceptionHandler) {
            \call_user_func($this->prevErrorHandler, $exception);
        }
    }