From bbdd0f8d0acdb237c57376039458d3001bdf2963 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 20 Jul 2007 15:15:09 +0000 Subject: [PATCH] pretty up the hook error message with an explanation of what it should do instead --- includes/Hooks.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index cdbd742b11..20103db406 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -130,7 +130,9 @@ function wfRunHooks($event, $args = null) { } else { $prettyFunc = strval( $callback ); } - throw new MWException( "Invalid NULL return from broken hook $prettyFunc" ); + throw new MWException( "Detected bug in an extension! " . + "Hook $prettyFunc failed to return a value; " . + "should return true to continue hook processing or false to abort." ); } else if (!$retval) { return false; } -- 2.20.1