mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 13:38:22 +01:00
Move error page to view
This commit is contained in:
parent
52ffae1b9f
commit
d0117795d7
@ -4,6 +4,7 @@ namespace Formwork\Core;
|
||||
|
||||
use Formwork\Utils\Header;
|
||||
use Formwork\Utils\HTTPResponse;
|
||||
use Formwork\View\View;
|
||||
use ErrorException;
|
||||
use Throwable;
|
||||
|
||||
@ -28,8 +29,8 @@ class Errors
|
||||
{
|
||||
HTTPResponse::cleanOutputBuffers();
|
||||
Header::status($status);
|
||||
$message = Header::HTTP_STATUS[$status];
|
||||
require FORMWORK_PATH . 'error.php';
|
||||
$view = new View('error', ['status' => $status, 'message' => Header::HTTP_STATUS[$status]]);
|
||||
$view->render();
|
||||
// Don't exit, otherwise the error will not be logged
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><?= $message ?? 'Internal Server Error' ?> | Formwork</title>
|
||||
<title><?= $message ?> | Formwork</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
@ -65,8 +65,8 @@
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
<span class="error-code"><?= $status ?? 500 ?></span>
|
||||
<span class="error-status"><?= $message ?? 'Internal Server Error' ?></span>
|
||||
<span class="error-code"><?= $status ?></span>
|
||||
<span class="error-status"><?= $message ?></span>
|
||||
</h1>
|
||||
<h2>Oops, something went wrong!</h2>
|
||||
<p>Formwork encountered an error while serving your request. Please check Formwork configuration or the server log for errors.</p>
|
Loading…
x
Reference in New Issue
Block a user