Page MenuHomePhabricator

MWException not formatted prettily (unlike Exception) class
Closed, ResolvedPublic


If you do throw new Exception( "foo" ); you get a pretty error page, rendered inside the current skin [if possible].

If you do throw new MWException( 'foo' ); you get just a backtrace with no formatting, which is very ugly.

I don't see why this should be like that. Both should be the same imo.

Event Timeline

Answer is apparently because $wgLang is typically a StubUserLang not a Language object. I guess with $wgLang being mostly deprecated, nothing calls it by that point to unstub it.

On a related note, I don't understand why we have 2 separate implementations for how to print exceptions depending on if it is MWException vs anything else.

Change 575987 had a related patch set uploaded (by Brian Wolff; owner: Brian Wolff):
[mediawiki/core@master] Make MWException show up pretty even if $wgLang is a stub

Change 575987 merged by jenkins-bot:
[mediawiki/core@master] Make MWException show up pretty even if $wgLang is a stub

Bawolff claimed this task.