public function output($statusCode)
    {
        // TODO: Refactor into a content-type option
        if (Director::is_ajax()) {
            return $this->getTitle();
        }

        $renderer = Debug::create_debug_view();
        $output = $renderer->renderHeader();
        $output .= $renderer->renderInfo("Website Error", $this->getTitle(), $this->getBody());

        $adminEmail = Email::config()->get('admin_email');
        if ($adminEmail) {
            $mailto = Email::obfuscate($adminEmail);
            $output .= $renderer->renderParagraph('Contact an administrator: ' . $mailto . '');
        }

        $output .= $renderer->renderFooter();
        return $output;
    }