exception: Move logging logic to static method of MWExceptionHandler
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 9 Oct 2013 00:20:41 +0000 (02:20 +0200)
committerOri.livneh <ori@wikimedia.org>
Mon, 14 Oct 2013 05:00:40 +0000 (05:00 +0000)
commitf0386d31835b8f65fb7fc1f275d1761cae339e97
treed36790aeb44ffac0ce220ada00033b4cf35a1bc5
parentd1dad246e849dbb76efc74af5f2d5de752b5b5df
exception: Move logging logic to static method of MWExceptionHandler

Follows-up c28251a9fd, which unconditionally called logException
on objects that aren't always instances of MWException.

This makes it possible to, for example, log PHP errors or errors
from Less in ResourceLoader to be logged as well (which naturally
don't have a logException method).

As a result of the handling now being generic, non-MWException
errors will now be loggable, and also have their ID fixed between
HTML output and the debug log entry.

* Not yet removing MWException::getLogMessage (introduced in bcb9f9e1c)
  as it has been around since 2006 (released in 1.8.0).

* Not yet removing MWException::getLogId (introduced in 70841c5867)
  as it was part of the 1.20.0 release.

* Removed MWException::logException (introduced in c28251a9fd)
  as it was only added a few weeks ago within this release cycle.

Change-Id: Iab98e3a7a9b78d8602e69e0571b35cf107a96b72
includes/Exception.php
includes/resourceloader/ResourceLoader.php