diff options
| author | 2015-01-31 14:48:35 +0100 | |
|---|---|---|
| committer | 2015-01-31 14:48:35 +0100 | |
| commit | c29b6d4c226cf9c45d7d372ee4bce3bcbcca99a6 (patch) | |
| tree | 9a8f2be9185cd110988bf8a687aaa316c9145db9 /lib/Minz/Error.php | |
| parent | e92acfd8227bc3ac94e9039343ff76c20facf29a (diff) | |
| parent | e91b72b63cd11ae3c4f59e48439e93955242c673 (diff) | |
Merge branch 'dev' into beta
Conflicts:
README.fr.md
README.md
Diffstat (limited to 'lib/Minz/Error.php')
| -rw-r--r-- | lib/Minz/Error.php | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php index 3eadc6d98..3e4a3e8f3 100644 --- a/lib/Minz/Error.php +++ b/lib/Minz/Error.php @@ -23,42 +23,13 @@ class Minz_Error { $logs = self::processLogs ($logs); $error_filename = APP_PATH . '/Controllers/errorController.php'; - switch ($code) { - case 200 : - header('HTTP/1.1 200 OK'); - break; - case 403 : - header('HTTP/1.1 403 Forbidden'); - break; - case 404 : - header('HTTP/1.1 404 Not Found'); - break; - case 500 : - header('HTTP/1.1 500 Internal Server Error'); - break; - case 503 : - header('HTTP/1.1 503 Service Unavailable'); - break; - default : - header('HTTP/1.1 500 Internal Server Error'); - } - if (file_exists ($error_filename)) { - $params = array ( - 'code' => $code, - 'logs' => $logs - ); + Minz_Session::_param('error_code', $code); + Minz_Session::_param('error_logs', $logs); - if ($redirect) { - Minz_Request::forward (array ( - 'c' => 'error' - ), true); - } else { - Minz_Request::forward (array ( - 'c' => 'error', - 'params' => $params - ), false); - } + Minz_Request::forward (array ( + 'c' => 'error' + ), $redirect); } else { echo '<h1>An error occured</h1>' . "\n"; |
