r111955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111954‎ | r111955 | r111956 >
Date:19:19, 20 February 2012
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
Don't output skinned errors in case of unhandled API exceptions
Modified paths:
  • /trunk/phase3/includes/Exception.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exception.php
@@ -203,7 +203,11 @@
204204 wfDebugLog( 'exception', $log );
205205 }
206206
207 - if ( self::isCommandLine() ) {
 207+ if ( defined( 'MW_API' ) ) {
 208+ // Unhandled API exception, we can't be sure that format printer is alive
 209+ header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $this ) );
 210+ wfHttpError(500, 'Internal Server Error', $this->getText() );
 211+ } elseif ( self::isCommandLine() ) {
208212 MWExceptionHandler::printError( $this->getText() );
209213 } else {
210214 $this->reportHTML();

Comments

#Comment by IAlex (talk | contribs)   19:38, 20 February 2012

Would it be possible to use something else than wfHttpError()?

Status & tagging log