Fix/hack ErrorPageError to work from non-UI contexts
authorChad Horohoe <chadh@wikimedia.org>
Thu, 6 Jul 2017 19:42:11 +0000 (12:42 -0700)
committerChad <chadh@wikimedia.org>
Thu, 6 Jul 2017 20:04:31 +0000 (20:04 +0000)
commit25c3c061b51cbfe377ebb2decbe09f7db7bc7397
tree99fcb6a0fa597b2502d3934f013540bfa5a97d3b
parent68e16c26dd58afdf58a97f18f3cc76ed3b0ad9ee
Fix/hack ErrorPageError to work from non-UI contexts

Right now, ErrorPageError *assumes* you're never running on the cli
or the API. It's kinda a crappy superclass to use for errors unless
you're 1000% sure you'll never hit that code path. Yay assumptions!

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
includes/exception/ErrorPageError.php
tests/phpunit/includes/exception/ErrorPageErrorTest.php