+function abort($body, $status = NULL) {
+ if ($status) header("HTTP/1.1 $status");
+ print "$body\n";
+ exit;
+}
+
+# custom error handling
+
+define('DOCROOT', getcwd());
+set_include_path(implode(PATH_SEPARATOR, [ DOCROOT, __DIR__ ]));
+
+function fail($error)
+{
+ global $User, $Page;
+ http_response_code(500);
+ if (!isset($Page)) {
+ require_once('article.inc.php');
+ $Page = new ArchiveArticle(NULL);
+ $Page->title = 'Fout';
+ }