exception: Use MWExceptionHandler::logException in more places
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 11 Oct 2013 19:22:40 +0000 (21:22 +0200)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 30 Oct 2013 22:46:35 +0000 (15:46 -0700)
commit4468a46af23a9eb86536f6bd5e19c37d1b82ac8f
tree89264a3a7da3df0d89bf5321e3d64a9e52ec9465
parent47f46381e34544e47fb46bd7bb3e203bf85479c6
exception: Use MWExceptionHandler::logException in more places

Most code replaced wasn't exactly like what logException does
but most probably should be.

A few implementation differences with the code it replaced in
various places:

* MWException if-guards
  Was there only to prevent a crash because getLogMessage is an
  MWException method. Now that logException is generic, it seems
  sensible to start logging those as well (follows-up a97f3550a0).

* Exception::getTraceAsString
  Now using MWExceptionHandler::formatRedactedTrace instead.
  It wasn't using it because that method didn't exist yet.

Notes:

* DatabaseError::getLogMessage
  Removed as this override was no longer doing anything (we're using
  MWExceptionHandler::getLogMessage instead of $e->getLogMessage).
  Introduced isLoggable() to take over the responsibility of indicating
  when an exception should not be logged (follows-up bcb9f9e1c0d).

* DeferredUpdates and Wiki.php
  Both specificy MWException. Though ApiMain intends to catch all
  and only logged MWException because it couldn't otherwise, these
  actually only catch MWException (as opposed to catching all and
  having an if-statement inside). Left those as-is to have them
  continue propagate other exceptions.

* JobQueueFederated and JobQueueGroup
  All specify to catch JobQueueError only.
  Not sure whether it should catch other exceptions. It now can,
  but I'll leave it as is in case it intends to have those be
  handled elsewhere (or fatal).

Change-Id: I4578a0fe7d95a080f1a3b292ce7ae73a4d5fcaca
includes/DeferredUpdates.php
includes/Exception.php
includes/Wiki.php
includes/api/ApiMain.php
includes/db/DatabaseError.php
includes/job/JobQueueGroup.php