public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
    {
        $is_handled = false;
        if (!$this->is_handling && !$this->last_error) {
            $this->swapCallable($running_env, $callback, $this->running_env, false);
            $this->setRunningEnvironment($running_env);
            if ($callback) {
                $this->setCallback($callback);
            }
            
            $this->prev_exception_handler = set_exception_handler($this->getUncaughtExceptionHandler());
            $this->prev_error_handler     = set_error_handler($this->getCoreErrorHandler());
            register_shutdown_function(function() {
                    if ($error = error_get_last()) {
                        $this->handleCoreError(
                            $error["type"],
                            $error["message"],
                            $error["file"],
                            $error["line"]
                        );
                    }
                });
            
            $this->is_handling = true;
            $is_handled = true;
        }

        return $is_handled;
    }