mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
unify exception and error handling.
This commit is contained in:
parent
3cee3b0e99
commit
a02ab67521
4 changed files with 12 additions and 12 deletions
|
@ -189,9 +189,9 @@ class ExceptionRenderer {
|
|||
$this->controller->set(array(
|
||||
'code' => $code,
|
||||
'url' => h($url),
|
||||
'name' => h($error->getMessage()),
|
||||
'message' => h($error->getMessage()),
|
||||
'error' => $error,
|
||||
'_serialize' => array('code', 'url', 'name')
|
||||
'_serialize' => array('code', 'url', 'message')
|
||||
));
|
||||
$this->controller->set($error->getAttributes());
|
||||
$this->_outputMessage($this->template);
|
||||
|
@ -211,10 +211,10 @@ class ExceptionRenderer {
|
|||
$url = $this->controller->request->here();
|
||||
$this->controller->response->statusCode($error->getCode());
|
||||
$this->controller->set(array(
|
||||
'name' => h($message),
|
||||
'url' => h($url),
|
||||
'message' => h($message),
|
||||
'error' => $error,
|
||||
'_serialize' => array('name', 'url')
|
||||
'_serialize' => array('url', 'message')
|
||||
));
|
||||
$this->_outputMessage('error400');
|
||||
}
|
||||
|
@ -234,10 +234,10 @@ class ExceptionRenderer {
|
|||
$code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500;
|
||||
$this->controller->response->statusCode($code);
|
||||
$this->controller->set(array(
|
||||
'name' => h($message),
|
||||
'message' => h($url),
|
||||
'url' => h($url),
|
||||
'message' => h($message),
|
||||
'error' => $error,
|
||||
'_serialize' => array('name', 'message')
|
||||
'_serialize' => array('url', 'message')
|
||||
));
|
||||
$this->_outputMessage('error500');
|
||||
}
|
||||
|
@ -255,9 +255,9 @@ class ExceptionRenderer {
|
|||
$this->controller->set(array(
|
||||
'code' => $code,
|
||||
'url' => h($url),
|
||||
'name' => h($error->getMessage()),
|
||||
'message' => h($error->getMessage()),
|
||||
'error' => $error,
|
||||
'_serialize' => array('code', 'url', 'name', 'error')
|
||||
'_serialize' => array('code', 'url', 'message', 'error')
|
||||
));
|
||||
$this->_outputMessage($this->template);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h2><?php echo $name; ?></h2>
|
||||
<h2><?php echo $message; ?></h2>
|
||||
<p class="error">
|
||||
<strong><?php echo __d('cake', 'Error'); ?>: </strong>
|
||||
<?php printf(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h2><?php echo $name; ?></h2>
|
||||
<h2><?php echo $message; ?></h2>
|
||||
<p class="error">
|
||||
<strong><?php echo __d('cake', 'Error'); ?>: </strong>
|
||||
<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<h2><?php echo __d('cake_dev', 'Database Error'); ?></h2>
|
||||
<p class="error">
|
||||
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
|
||||
<?php echo $name; ?>
|
||||
<?php echo $message; ?>
|
||||
</p>
|
||||
<?php if (!empty($error->queryString)) : ?>
|
||||
<p class="notice">
|
||||
|
|
Loading…
Reference in a new issue