diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 85c01f4e188..4afda19414c 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -123,6 +123,7 @@ production. log when determining whether an account is used. * (bug 43379) Gracefully fail if rev_len is unavailable for a revision on the History page. +* (bug 42949) API no longer assumes all exceptions are MWException. === API changes in 1.21 === * prop=revisions can now report the contentmodel and contentformat. diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 97f5ecd61ea..1e8c84edce3 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -375,7 +375,7 @@ class ApiMain extends ApiBase { wfRunHooks( 'ApiMain::onException', array( $this, $e ) ); // Log it - if ( !( $e instanceof UsageException ) ) { + if ( $e instanceof MWException && !( $e instanceof UsageException ) ) { global $wgLogExceptionBacktrace; if ( $wgLogExceptionBacktrace ) { wfDebugLog( 'exception', $e->getLogMessage() . "\n" . $e->getTraceAsString() . "\n" );