From 370e83bb0dfd0c70de268c93bf07ad5ee0897192 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 15 Aug 2008 01:29:47 +0200 Subject: Update auf 1.13.0 --- includes/AjaxDispatcher.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'includes/AjaxDispatcher.php') diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 7b85ed20..c489cf1c 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -1,5 +1,9 @@ func_name, $wgAjaxExportList ) ) { + wfDebug( __METHOD__ . ' Bad Request for unknown function ' . $this->func_name . "\n" ); + wfHttpError( 400, 'Bad Request', "unknown function " . (string) $this->func_name ); } else { + wfDebug( __METHOD__ . ' dispatching ' . $this->func_name . "\n" ); + if ( strpos( $this->func_name, '::' ) !== false ) { $func = explode( '::', $this->func_name, 2 ); } else { @@ -93,6 +102,10 @@ class AjaxDispatcher { $result = call_user_func_array($func, $this->args); if ( $result === false || $result === NULL ) { + wfDebug( __METHOD__ . ' ERROR while dispatching ' + . $this->func_name . "(" . var_export( $this->args, true ) . "): " + . "no data returned\n" ); + wfHttpError( 500, 'Internal Error', "{$this->func_name} returned no data" ); } @@ -103,9 +116,15 @@ class AjaxDispatcher { $result->sendHeaders(); $result->printText(); + + wfDebug( __METHOD__ . ' dispatch complete for ' . $this->func_name . "\n" ); } } catch (Exception $e) { + wfDebug( __METHOD__ . ' ERROR while dispatching ' + . $this->func_name . "(" . var_export( $this->args, true ) . "): " + . get_class($e) . ": " . $e->getMessage() . "\n" ); + if (!headers_sent()) { wfHttpError( 500, 'Internal Error', $e->getMessage() ); @@ -119,5 +138,3 @@ class AjaxDispatcher { $wgOut = null; } } - - -- cgit v1.2.2