diff --git a/xmppdaemon.php b/xmppdaemon.php index 9aaa953fd0..c8e2ba16f1 100755 --- a/xmppdaemon.php +++ b/xmppdaemon.php @@ -18,6 +18,13 @@ * along with this program. If not, see . */ +function xmppdaemon_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { + print "Error $errno in $errfile[$errline]: $errstr\n"; + die(); +} + +set_error_handler('xmppdaemon_error_handler'); + # Abort if called from a web server if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { print "This script must be run from the command line\n";