public function importCustomErrorPage($e = null)
    {
        $path = CYGNITE_BASE.DS.toPath(APPPATH.'/Views/errors/');
        if ($e == null) {
            Debugger::$errorTemplate = include $path.'500.view'.EXT;
        }

        $statusCode = 500;
        if (method_exists($e, 'getStatusCode')) {
            $statusCode = $e->getStatusCode();
        } else {
            if (method_exists($e, 'getCode')) {
                $statusCode = $e->getCode();
            }
        }

        if ($statusCode == 0) {
            $statusCode = 500;
        }

        if (file_exists($path.$statusCode.'.view'.EXT)) {
            $error = ['error.code' => $statusCode, 'message' => $e->getMessage()];
            extract($error);
            Debugger::$errorTemplate = include $path.$statusCode.'.view'.EXT;
        } else {
            throw new \Exception('Error view file not exists '.$path.$e->getStatusCode().'.view'.EXT);
        }
    }