resourceloader: Log load.php exceptions to JavaScript console
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 15 Sep 2015 03:17:47 +0000 (04:17 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 15 Sep 2015 03:20:30 +0000 (04:20 +0100)
commitd478ffde100563abaddbfcb69dd9ad40f7def8d9
tree2736da73fe7faa781129266e6c666c3a026bb94b
parent47dda77573f27d4126690dfc00df5c10224d1488
resourceloader: Log load.php exceptions to JavaScript console

* Use implode() instead of foreach concat.
* Use two new lines instead of just one since the exception message
  with stacktrace spans multiple lines (makes it easier to distinguish
  when there are indeed exceptions from multiple sources).
* Output a single comment instead of one for each.
* If context is a JavaScript response, also include a console.error
  call with the erro message.

To try out:
* Break a file module descriptor in Resources.php by e.g. making
  a typo in one of the scripts arrays.
* View a page on-wiki that uses the module (e.g. jquery.accessKeyLabel
  is loaded on most pages).
* Observe error in the console.

Bug: T110659
Change-Id: I4272795f1fab96a2effe2a6c068a56421adaa512
includes/resourceloader/ResourceLoader.php