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