resources: Collapse all jQuery UI modules into one deprecated mega-module
[lhc/web/wiklou.git] / maintenance / doMaintenance.php
index 94ae95d..fe4905b 100644 (file)
@@ -95,7 +95,25 @@ $maintenance->setAgentAndTriggers();
 $maintenance->validateParamsAndArgs();
 
 // Do the work
-$success = $maintenance->execute();
+try {
+       $success = $maintenance->execute();
+} catch ( Exception $ex ) {
+       $success = false;
+       $exReportMessage = '';
+       while ( $ex ) {
+               $cls = get_class( $ex );
+               $exReportMessage .= "$cls from line {$ex->getLine()} of {$ex->getFile()}: {$ex->getMessage()}\n";
+               $exReportMessage .= $ex->getTraceAsString() . "\n";
+               $ex = $ex->getPrevious();
+       }
+       // Print the exception to stderr if possible, don't mix it in
+       // with stdout output.
+       if ( defined( 'STDERR' ) ) {
+               fwrite( STDERR, $exReportMessage );
+       } else {
+               echo $exReportMessage;
+       }
+}
 
 // Potentially debug globals
 $maintenance->globals();