From 118a98ab9ad86443db87656c8139d0cecd98d4a7 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sat, 23 Apr 2011 00:45:32 +1000 Subject: [PATCH] error handling --- inc/functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/functions.php b/inc/functions.php index e3785298..67104189 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -96,6 +96,13 @@ memcached_open(); } + function fatal_error_handler() { + if($error = error_get_last()) { + echo 'Caught fatal error: ' . $error['message'] . ' in ' . $error['file'] . ' on line ' . $error['line']; + } + } + register_shutdown_function('fatal_error_handler'); + // Memcached function memcached_open() { global $memcached, $config;