Chad has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/363660 )
Change subject: WIP: Fix ErrorPageError to work from non-web contexts
......................................................................
WIP: Fix ErrorPageError to work from non-web contexts
Right now, ErrorPageError *assumes* you're never running on the cli.
It's kinda a crappy superclass to use for errors unless you're 1000%
sure you'll never hit that code path from the cli.
Ideally, all of this report() crap is cleaned up and unified across
the like 1192902117 places we have it spread out, but for now just
detect the scenario and delegate back to MWException, which does the
right thing
Bug: T168337
Change-Id: Ia2f490528e128527a7a5ef1f4f5eea36ec9ee810
---
M includes/exception/ErrorPageError.php
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/60/363660/1
diff --git a/includes/exception/ErrorPageError.php
b/includes/exception/ErrorPageError.php
index 2bed87a..508d8ed 100644
--- a/includes/exception/ErrorPageError.php
+++ b/includes/exception/ErrorPageError.php
@@ -61,9 +61,12 @@
}
public function report() {
- global $wgOut;
-
- $wgOut->showErrorPage( $this->title, $this->msg, $this->params
);
- $wgOut->output();
+ if ( self::isCommandLine() ) {
+ parent::report();
+ } else {
+ global $wgOut;
+ $wgOut->showErrorPage( $this->title, $this->msg,
$this->params );
+ $wgOut->output();
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/363660
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2f490528e128527a7a5ef1f4f5eea36ec9ee810
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits