-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patherror.php
More file actions
61 lines (57 loc) · 1.33 KB
/
error.php
File metadata and controls
61 lines (57 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/*
* This script is used to report unhandled errors in our
* web application. It is typically sent here when there
* is an unhandled error or an unhandled exception.
*
* In both cases, the session data has hopefully been primed
* with data that we can use to print a more helpful message
* for the user.
*/
ob_start();
require_once 'lib/core.php';
if (isset($_SESSION['exception']))
{
$exc = $_SESSION['exception'];
$msg = $exc->getMessage();
}
else if (isset($_SESSION['errstr']))
{
$msg = $_SESSION['errstr'];
}
else if (!isset($_SESSION))
{
$msg = "Unable to initialise the session. Please verify that the session data directory exists.";
}
else
{
$msg = "Unknown Error";
}
/*
* Make sure that the next time an error occurs, we reset
* these error data.
*/
unset($_SESSION['exception']);
unset($_SESSION['errstr']);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Error</title>
<link rel="stylesheet" href="css/app.css"/>
</head>
<body>
<h2>Unexpected Error</h2>
<p>
Please click <a href='index.php'>here</a> to go back to the main page and continue working with our system.
</p>
<p>
The error received was: <br/><br/>
<b><?php echo $msg ?></b>
</p>
</body>
</html>
<?php
ob_end_flush();
?>