Example #1
0
 /**
  * Overrides MWException::report to also write exceptions to error_log
  *
  * @see  MWException::report
  */
 function report()
 {
     $file = $this->getFile();
     $line = $this->getLine();
     $message = $this->getMessage();
     $request = RequestContext::getMain()->getRequest();
     $url = '[no URL]';
     if (isset($request)) {
         $url = $request->getFullRequestURL();
     }
     trigger_error("Exception from line {$line} of {$file}: {$message} ({$url})", E_USER_ERROR);
     /*
     bust the headers_sent check in MWException::report()
     Uncomment to override normal MWException headers
     in order to display an error page instead of a 500 error
     WARNING: Varnish doesn't like those
     flush();
     */
     parent::report();
 }
Example #2
0
 /**
  * Override MWException report() and write exceptions to error_log
  *
  * Uncomment the flush() line to override normal MWException headers
  * so we can display an error page instead of a 500 error (varnish doesn't like those)
  *
  * TODO: display a nice walter?
  */
 function report()
 {
     global $wgRequest;
     $file = $this->getFile();
     $line = $this->getLine();
     $message = $this->getMessage();
     $url = '[no URL]';
     if (isset($wgRequest)) {
         $url = $wgRequest->getFullRequestURL();
     }
     trigger_error("Exception from line {$line} of {$file}: {$message} ({$url})", E_USER_ERROR);
     //flush();   // bust the headers_sent check in MWException::report()
     parent::report();
 }