Render error messages in the container itself

fixes #6280
This commit is contained in:
Marius Hein 2015-01-30 14:50:25 +01:00
parent 17b6d8512b
commit 6ec2ee753d
3 changed files with 5 additions and 17 deletions

View File

@ -19,6 +19,7 @@ class ErrorController extends ActionController
{ {
$error = $this->_getParam('error_handler'); $error = $this->_getParam('error_handler');
$exception = $error->exception; $exception = $error->exception;
$this->getTabs()->showOnlyCloseButton();
Logger::error($exception); Logger::error($exception);
Logger::error('Stacktrace: %s', $exception->getTraceAsString()); Logger::error('Stacktrace: %s', $exception->getTraceAsString());

View File

@ -1,8 +1,9 @@
<?php if ($this->title): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this) ?>
<?php if ($this->title): ?>
<h1><?= $this->escape($title) ?></h1> <h1><?= $this->escape($title) ?></h1>
</div>
<?php endif ?> <?php endif ?>
</div>
<div class="content"> <div class="content">
<?php if ($this->message): ?> <?php if ($this->message): ?>
<p><strong><?= nl2br($this->escape($message)) ?></strong></p> <p><strong><?= nl2br($this->escape($message)) ?></strong></p>

View File

@ -594,18 +594,7 @@
onFailure: function (req, textStatus, errorThrown) { onFailure: function (req, textStatus, errorThrown) {
var url = req.url; var url = req.url;
if (req.status === 500) { if (req.status > 0) {
if (this.exception === null) {
req.$target.addClass('impact');
this.exception = this.createNotice(
'error',
$('h1', $(req.responseText)).first().html(),
true
);
this.icinga.ui.fixControls();
}
} else if (req.status > 0) {
this.icinga.logger.error( this.icinga.logger.error(
req.status, req.status,
errorThrown + ':', errorThrown + ':',
@ -617,9 +606,6 @@
req.action, req.action,
req.autorefresh req.autorefresh
); );
// Header example:
// Icinga.debug(req.getResponseHeader('X-Icinga-Redirect'));
} else { } else {
if (errorThrown === 'abort') { if (errorThrown === 'abort') {
this.icinga.logger.debug( this.icinga.logger.debug(