From e0ad91f058e3dd132a18f6b99cb8216996637db8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 29 Jul 2014 15:55:28 -0700 Subject: [PATCH] Just log exceptions instead of spamming them in JobRunner * Even the CLI script already shows the error=X snippet. Logging the error should be enough, and avoids showing output when all we want is the JSON. Change-Id: Iade412ea61cf427865d841ecab5498e4fcdb7e13 --- includes/jobqueue/JobRunner.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index 0f585c7dc6..9a4073f9a0 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -51,6 +51,9 @@ class JobRunner { * - elapsed : the total time spent running tasks in ms * - reached : the reason the script finished, one of (none-ready, job-limit, time-limit) * + * This method outputs status information only if a debug handler was set. + * Any exceptions are caught and logged, but are not reported as output. + * * @param array $options * @return array Summary response that can easily be JSON serialized */ @@ -110,7 +113,7 @@ class JobRunner { MWExceptionHandler::rollbackMasterChangesAndLog( $e ); $status = false; $error = get_class( $e ) . ': ' . $e->getMessage(); - $e->report(); // write error to STDERR and the log + MWExceptionHandler::logException( $e ); } $timeMs = intval( ( microtime( true ) - $t ) * 1000 ); wfProfileOut( __METHOD__ . '-' . get_class( $job ) ); -- 2.20.1