forked from Public/pics
ErrorHandler: fix longstanding typo, occur*r*ed
This commit is contained in:
parent
f5721c3af7
commit
6150922a1f
@ -131,7 +131,7 @@ class ErrorHandler
|
|||||||
]))
|
]))
|
||||||
{
|
{
|
||||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||||
echo '<h2>An Error Occured</h2><p>Our software could not connect to the database. We apologise for any inconvenience and ask you to check back later.</p>';
|
echo '<h2>An Error Occurred</h2><p>Our software could not connect to the database. We apologise for any inconvenience and ask you to check back later.</p>';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,18 +156,18 @@ class ErrorHandler
|
|||||||
elseif (!$is_sensitive)
|
elseif (!$is_sensitive)
|
||||||
echo json_encode(['error' => $message]);
|
echo json_encode(['error' => $message]);
|
||||||
else
|
else
|
||||||
echo json_encode(['error' => 'Our apologies, an error occured while we were processing your request. Please try again later, or contact us if the problem persists.']);
|
echo json_encode(['error' => 'Our apologies, an error occurred while we were processing your request. Please try again later, or contact us if the problem persists.']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialise the main template to present a nice message to the user.
|
// Initialise the main template to present a nice message to the user.
|
||||||
$page = new MainTemplate('An error occured!');
|
$page = new MainTemplate('An error occurred!');
|
||||||
|
|
||||||
// Show the error.
|
// Show the error.
|
||||||
$is_admin = Registry::has('user') && Registry::get('user')->isAdmin();
|
$is_admin = Registry::has('user') && Registry::get('user')->isAdmin();
|
||||||
if (DEBUG || $is_admin)
|
if (DEBUG || $is_admin)
|
||||||
{
|
{
|
||||||
$page->adopt(new DummyBox('An error occured!', '<p>' . $message . '</p><pre>' . $debug_info . '</pre>'));
|
$page->adopt(new DummyBox('An error occurred!', '<p>' . $message . '</p><pre>' . $debug_info . '</pre>'));
|
||||||
|
|
||||||
// Let's provide the admin navigation despite it all!
|
// Let's provide the admin navigation despite it all!
|
||||||
if ($is_admin)
|
if ($is_admin)
|
||||||
@ -176,9 +176,9 @@ class ErrorHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (!$is_sensitive)
|
elseif (!$is_sensitive)
|
||||||
$page->adopt(new DummyBox('An error occured!', '<p>' . $message . '</p>'));
|
$page->adopt(new DummyBox('An error occurred!', '<p>' . $message . '</p>'));
|
||||||
else
|
else
|
||||||
$page->adopt(new DummyBox('An error occured!', '<p>Our apologies, an error occured while we were processing your request. Please try again later, or contact us if the problem persists.</p>'));
|
$page->adopt(new DummyBox('An error occurred!', '<p>Our apologies, an error occurred while we were processing your request. Please try again later, or contact us if the problem persists.</p>'));
|
||||||
|
|
||||||
// If we got this far, make sure we're not showing stuff twice.
|
// If we got this far, make sure we're not showing stuff twice.
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
Loading…
Reference in New Issue
Block a user