In I1b7396ceb, we were trying to log failures to Special:Log, but
since $this->dieUsage throws an exception, the log entry insertion
was being rolled back.
This is similar to I36cd645d which was for index.php calls.
Change-Id: I136ba66d2f939fcdd0c9326e04d686a30449bf4c
Follows-Up: I8f1da51187b281fe4afc0d5a0c49f5caf3612e92
*/
protected function handleException( Exception $e ) {
// Bug 63145: Rollback any open database transactions
- MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+ if ( !( $e instanceof UsageException ) ) {
+ // UsageExceptions are intentional, so don't rollback if that's the case
+ MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+ }
// Allow extra cleanup and logging
wfRunHooks( 'ApiMain::onException', array( $this, $e ) );