public static function handle(Exception $exception)
    {
        // Sometimes errors thrown before subsystem is ready - in this case its always told to outside but logged
        $debug = (true === defined('DOOZR_DEBUGGING')) ? DOOZR_DEBUGGING : true;

        // In range of 100 - 599 we do send a HTTP response by logic and laws of Doozr
        if ($exception->getCode() < 100 || $exception->getCode() > 599) {
            $statusCode = 500;
        } else {
            $statusCode = $exception->getCode();
        }

        // Information disclosure protection. Only in debug we show what really happened
        if (true === $debug) {
            $message = $exception->getMessage();
            $code    = $exception->getCode();
        } else {
            $message = constant('Doozr_Http::REASONPHRASE_'.$statusCode);
            $code    = $statusCode;
        }

        // Simple exception switch by runtime environment
        if (Doozr_Kernel::RUNTIME_ENVIRONMENT_WEB === DOOZR_RUNTIME_ENVIRONMENT) {
            self::handleHtml(
                $statusCode,
                $code,
                $message,
                $exception->getFile(),
                $exception->getLine()
            );
        } else {
            self::handleText(
                $code,
                $message,
                $exception->getFile(),
                $exception->getLine()
            );
        }
    }