protected function initContent() { self::httpStatusHeader(404); $this->setTitle(Page::getHttpStatusMsg(404)); $this->setRobots("noindex,nofollow"); return '<div class="alert alert-error">The page you requested could not be found.</div>'; }
protected function initContent() { global $swarmInstallDir; self::httpStatusHeader(500); $this->setTitle(Page::getHttpStatusMsg(500)); $this->setRobots("noindex,nofollow"); $e = $this->exceptionObj; $html = '<div class="alert alert-error">An internal error occurred.' . ' The following error message was caught:<br><br><strong>' . nl2br(htmlspecialchars($e->getMessage())) . '</strong></div>'; if ($this->getContext()->getConf()->debug->showExceptionDetails) { $html .= '<p>Caught in <code>.' . htmlspecialchars(substr($e->getFile(), strlen($swarmInstallDir))) . '</code> on line <code>' . htmlspecialchars($e->getLine()) . '</code>.</p><p>Backtrace:</p><pre>' . nl2br(htmlspecialchars($e->getTraceAsString())) . '</pre>'; } else { $html .= '<p><small><strong>To the administrator</strong>:</small>' . ' <br><small>To show detailed debugging information, set' . ' <tt>"showExceptionDetails": true</tt> in the <tt>"debug"</tt> section' . ' of the configuration file.</small></p>'; } return $html; }