resourceloader: Write to debug log for all fatal errors
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 2 May 2013 01:27:58 +0000 (03:27 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 20 May 2013 19:39:27 +0000 (19:39 +0000)
commit7142afaba0d9e1915e7ff7d4d2fbb3a1b0dcd040
treecf791d44ab9d23bee40169276eed60cdb3d668a3
parentbce48e94209948ac74f2cb4911bb5c3f280d08c7
resourceloader: Write to debug log for all fatal errors

There's various fatal errors that can happen in ResourceLoader.
Since in a javascript/css response there is no error page we can
show, we currently catch them all and output them in a block
comment on top of load.php.

This maintains valid syntax for the response and keeps the error
easy to view (if you're looking for it in the browser).

However from a debugging perspective it is a nightmare. Literally
the only visible difference from a normal request response is
the cache maxage (if hasErrors: use unversionsed maxage).

For all errors we currently already catch and write to request
response outpout, also write to debug log.

This also helps in fixing bug #.

This commit basically changes the following pattern:

    // Add exception to the output as a comment
    $errors .= $this->makeComment( $e->__toString() );
    $this->hasErrors = true;

to:

    wfDebugLog( 'resourceloader', __METHOD__ . ": <failure summary>: $e\n" );
    $this->hasErrors = true;
    // Add exception to the output as a comment
    $errors .= $this->makeComment( $e->__toString() );

Bug: 44018
Change-Id: I684f6492f839a6c6adb07b0640e88cfea21fcf60
includes/resourceloader/ResourceLoader.php