Always log exceptions in rollbackMasterChangesAndLog()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 30 Jun 2017 22:01:33 +0000 (15:01 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 30 Jun 2017 22:32:47 +0000 (22:32 +0000)
commit806a2214e29fa3d35daef6469c1ea14dba2957ab
tree76bcff4892e6e381d1804e07859a9983a2af8570
parent6711b872b892df544fd17633034535c8fc64849c
Always log exceptions in rollbackMasterChangesAndLog()

MWExceptionHandler::rollbackMasterChangesAndLog() only logged exceptions
if there were already master changes. This is extremely problematic when
debugging, especially in situations like DeferredUpdates where they were
silently being swallowed.

This makes it log exceptions in all paths, erring on the side of logging
the same exception twice (theoretically it's possible I suppose) instead
of not at all.

Also make the method able to handle DBError exceptions, which most of
the callers seemed to be assuming. ApiMain was handling this explicitly.

Bug: T168347
Change-Id: I8739051f824a455ba669344184c3b11ac95cb561
includes/api/ApiMain.php
includes/exception/MWExceptionHandler.php