From af106b0ebe0b34189a83bbfb64e9c9ace044a273 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 31 Mar 2006 06:18:55 +0100 Subject: better fatal error handling by frontend (remove error.php) --- backend.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index 5554adae2..df3e7d036 100644 --- a/backend.php +++ b/backend.php @@ -20,12 +20,17 @@ require_once "sanity_check.php"; require_once "config.php"; + + require_once "db.php"; + require_once "db-prefs.php"; + require_once "functions.php"; + require_once "magpierss/rss_fetch.inc"; $err_msg = check_configuration_variables(); if ($err_msg) { - print "Fatal error: $err_msg"; - exit; + header("Content-Type: application/xml"); + print_error_xml(9, $err_msg); die; } if ((!$op || $op == "rpc" || $op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) { @@ -35,7 +40,7 @@ if (!$_SESSION["uid"] && $op != "globalUpdateFeeds") { if ($op == "rpc") { - print ""; + print_error_xml(6); die; } else { print " @@ -54,15 +59,9 @@ } if (!$op) { - print ""; - exit; + print_error_xml(7); exit; } - require_once "db.php"; - require_once "db-prefs.php"; - require_once "functions.php"; - require_once "magpierss/rss_fetch.inc"; - $purge_intervals = array( 0 => "Default", -1 => "Never purge", -- cgit v1.2.3