Improve database endAtomic() error messages
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 21 Jul 2016 17:48:50 +0000 (10:48 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 21 Jul 2016 17:48:50 +0000 (10:48 -0700)
Change-Id: I3317012befe454654429bb5acb8988d4e7ccfb5a

includes/db/Database.php

index f23e24f..9b73584 100644 (file)
@@ -2564,12 +2564,12 @@ abstract class DatabaseBase implements IDatabase {
 
        final public function endAtomic( $fname = __METHOD__ ) {
                if ( !$this->mTrxLevel ) {
-                       throw new DBUnexpectedError( $this, 'No atomic transaction is open.' );
+                       throw new DBUnexpectedError( $this, "No atomic transaction is open (got $fname)." );
                }
                if ( !$this->mTrxAtomicLevels ||
                        array_pop( $this->mTrxAtomicLevels ) !== $fname
                ) {
-                       throw new DBUnexpectedError( $this, 'Invalid atomic section ended.' );
+                       throw new DBUnexpectedError( $this, "Invalid atomic section ended (got $fname)." );
                }
 
                if ( !$this->mTrxAtomicLevels && $this->mTrxAutomaticAtomic ) {