resourceloader: Include backtrace in formatted errors (if enabled)
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 3 Dec 2016 03:57:42 +0000 (19:57 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 16 Dec 2016 02:32:24 +0000 (02:32 +0000)
commitf8ceb5c237aaa3b80d38199d639359fbcfe6b823
tree76ef2fb975d4a9d02615668a9a06a02ad411bd5f
parent466939c6318e548e064dcbfbed694c41b425b2a9
resourceloader: Include backtrace in formatted errors (if enabled)

Make ResourceLoader error formatting the same as everywhere else.
Which means if wgShowExceptionDetails is enabled locally, the
trace will be included as well.

This matches logic in MWExceptionRenderer.

Also move the typical error handling used by respond() to a
utility method to reduce duplication of code and avoid mistakes.

Change-Id: If04ae99618e4a758ed0f9dd2b555496b76da29de
includes/resourceloader/ResourceLoader.php