Merge pull request #2594 from dereuromark/2.5-error-handling

2.5 error handling
This commit is contained in:
Mark Story 2014-01-05 08:00:39 -08:00
commit 7e084da6e8
8 changed files with 18 additions and 14 deletions

View file

@ -16,7 +16,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
?> ?>
<h2><?php echo $name; ?></h2> <h2><?php echo $message; ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong> <strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php printf( <?php printf(

View file

@ -16,7 +16,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
?> ?>
<h2><?php echo $name; ?></h2> <h2><?php echo $message; ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong> <strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?> <?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>

View file

@ -7,7 +7,7 @@
* @since CakePHP(tm) v 0.10.0.1076 * @since CakePHP(tm) v 0.10.0.1076
*/ */
?> ?>
<h2><?php echo $name; ?></h2> <h2><?php echo $message; ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong> <strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php printf( <?php printf(

View file

@ -7,7 +7,7 @@
* @since CakePHP(tm) v 0.10.0.1076 * @since CakePHP(tm) v 0.10.0.1076
*/ */
?> ?>
<h2><?php echo $name; ?></h2> <h2><?php echo $message; ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong> <strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?> <?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>

View file

@ -188,10 +188,11 @@ class ExceptionRenderer {
$this->controller->response->statusCode($code); $this->controller->response->statusCode($code);
$this->controller->set(array( $this->controller->set(array(
'code' => $code, 'code' => $code,
'mame' => h($error->getMessage()),
'message' => h($error->getMessage()),
'url' => h($url), 'url' => h($url),
'name' => h($error->getMessage()),
'error' => $error, 'error' => $error,
'_serialize' => array('code', 'url', 'name') '_serialize' => array('code', 'name', 'message', 'url')
)); ));
$this->controller->set($error->getAttributes()); $this->controller->set($error->getAttributes());
$this->_outputMessage($this->template); $this->_outputMessage($this->template);
@ -212,9 +213,10 @@ class ExceptionRenderer {
$this->controller->response->statusCode($error->getCode()); $this->controller->response->statusCode($error->getCode());
$this->controller->set(array( $this->controller->set(array(
'name' => h($message), 'name' => h($message),
'message' => h($message),
'url' => h($url), 'url' => h($url),
'error' => $error, 'error' => $error,
'_serialize' => array('name', 'url') '_serialize' => array('name', 'message', 'url')
)); ));
$this->_outputMessage('error400'); $this->_outputMessage('error400');
} }
@ -235,9 +237,10 @@ class ExceptionRenderer {
$this->controller->response->statusCode($code); $this->controller->response->statusCode($code);
$this->controller->set(array( $this->controller->set(array(
'name' => h($message), 'name' => h($message),
'message' => h($url), 'message' => h($message),
'url' => h($url),
'error' => $error, 'error' => $error,
'_serialize' => array('name', 'message') '_serialize' => array('name', 'message', 'url')
)); ));
$this->_outputMessage('error500'); $this->_outputMessage('error500');
} }
@ -254,10 +257,11 @@ class ExceptionRenderer {
$this->controller->response->statusCode($code); $this->controller->response->statusCode($code);
$this->controller->set(array( $this->controller->set(array(
'code' => $code, 'code' => $code,
'url' => h($url),
'name' => h($error->getMessage()), 'name' => h($error->getMessage()),
'message' => h($error->getMessage()),
'url' => h($url),
'error' => $error, 'error' => $error,
'_serialize' => array('code', 'url', 'name', 'error') '_serialize' => array('code', 'name', 'message', 'url', 'error')
)); ));
$this->_outputMessage($this->template); $this->_outputMessage($this->template);
} }

View file

@ -1,4 +1,4 @@
<h2><?php echo $name; ?></h2> <h2><?php echo $message; ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong> <strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php printf( <?php printf(

View file

@ -1,4 +1,4 @@
<h2><?php echo $name; ?></h2> <h2><?php echo $message; ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong> <strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?> <?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>

View file

@ -19,7 +19,7 @@
<h2><?php echo __d('cake_dev', 'Database Error'); ?></h2> <h2><?php echo __d('cake_dev', 'Database Error'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo $name; ?> <?php echo $message; ?>
</p> </p>
<?php if (!empty($error->queryString)) : ?> <?php if (!empty($error->queryString)) : ?>
<p class="notice"> <p class="notice">