Index: trunk/phase3/includes/Exception.php |
— | — | @@ -203,7 +203,11 @@ |
204 | 204 | wfDebugLog( 'exception', $log ); |
205 | 205 | } |
206 | 206 | |
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() ) { |
208 | 212 | MWExceptionHandler::printError( $this->getText() ); |
209 | 213 | } else { |
210 | 214 | $this->reportHTML(); |