- $timing = $this->context->getTiming();
- $timing->mark( 'requestShutdown' );
-
- // Show visible profiling data if enabled (which cannot be post-send)
- Profiler::instance()->logDataPageOutputOnly();
+ // Perform the last synchronous operations...
+ try {
+ // Record backend request timing
+ $timing = $this->context->getTiming();
+ $timing->mark( 'requestShutdown' );
+ // Show visible profiling data if enabled (which cannot be post-send)
+ Profiler::instance()->logDataPageOutputOnly();
+ } catch ( Exception $e ) {
+ // An error may already have been shown in run(), so just log it to be safe
+ MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+ }