Print chained exceptions when maintenance script fails.
authordaniel <dkinzler@wikimedia.org>
Sun, 9 Dec 2018 21:22:17 +0000 (22:22 +0100)
committerDaniel Kinzler <dkinzler@wikimedia.org>
Mon, 10 Dec 2018 13:27:36 +0000 (13:27 +0000)
commite1e5beb43e740c9f850ad04401000f1ba90b5fbb
treee3cc202d389c809c93e9f8558461f8425ecec660
parent0833cae960f3360c1e2208122ed17dae08e24a90
Print chained exceptions when maintenance script fails.

PHP supports exception chaining. This patch will output the error
message and stack trace not just for the latest exceptions, but for all
exceptions in the chain, using the Exception::getPrevious() method. This
avoids the problem where aftereffects obscure the actual problem, because
only the last exception in the chain was printed.

Change-Id: If577c5c89bb3b3e5766400fff07d8cc0a2d82610
maintenance/doMaintenance.php