Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312077

Change subject: rpc: trick mw into generating a raw exception report
......................................................................

rpc: trick mw into generating a raw exception report

MWExceptionHandler::handleException() default to report a prettified
error message, ie as HTML with skin applied.

The jobrunner service logs the result which is a bit cumbersome when
looking at log files such as /var/log/mediawiki/jobrunner.log

MWExceptionRenderer::output() has a shortcircuit to emit raw whenever
MediaWiki has $wgCommandLine set.  Abuse that before invoking the
exception handler which lead to a raw message being logged.

That is pretty lame but handleException offers no choice.

Change-Id: I924836a59d792003ae16b1fbf97f5b600c5aee53
---
M rpc/RunJobs.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/77/312077/1

diff --git a/rpc/RunJobs.php b/rpc/RunJobs.php
index 055caac..68310f7 100755
--- a/rpc/RunJobs.php
+++ b/rpc/RunJobs.php
@@ -50,5 +50,8 @@
 
        $mediawiki->restInPeace();
 } catch ( Exception $e ) {
+       # Since output is logged to file, get MediaWiki to generate a raw error
+       $wgCommandLineMode = true;
+
        MWExceptionHandler::handleException( $e );
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/312077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I924836a59d792003ae16b1fbf97f5b600c5aee53
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to