public function enableErrorHandler(array $options = []): void
    {
        if ($this->errorHandlerEnabled) {
            throw new \Exception('The error handler is already enabled!');
        }
        set_exception_handler(function($exception) use ($options) {
            \BearFramework\Internal\ErrorHandler::handleException($this, $exception, $options);
        });
        register_shutdown_function(function() use ($options) {
            $errorData = error_get_last();
            if (is_array($errorData)) {
                \BearFramework\Internal\ErrorHandler::handleFatalError($this, $errorData, $options);
            }
        });
        set_error_handler(function($errorNumber, $errorMessage, $errorFile, $errorLine) {
            throw new \ErrorException($errorMessage, 0, $errorNumber, $errorFile, $errorLine);
        });
        $this->errorHandlerEnabled = true;
    }