18
18
import { assert } from '../util/assert' ;
19
19
import { Code , FirestoreError } from '../util/error' ;
20
20
import { debug } from '../util/log' ;
21
+ import * as log from '../util/log' ;
21
22
import { Deferred } from '../util/promise' ;
22
23
import { SCHEMA_VERSION } from './indexeddb_schema' ;
23
24
import { PersistencePromise } from './persistence_promise' ;
@@ -192,6 +193,7 @@ export class SimpleDb {
192
193
const transactionFnResult = transactionFn ( transaction )
193
194
. catch ( error => {
194
195
// Abort the transaction if there was an error.
196
+ log . error ( 'TransactionFn failed, aborting transaction.' , error ) ;
195
197
transaction . abort ( error ) ;
196
198
// We cannot actually recover, and calling `abort()` will cause the transaction's
197
199
// completion promise to be rejected. This in turn means that we won't use
@@ -312,7 +314,8 @@ export class SimpleDbTransaction {
312
314
this . transaction . oncomplete = ( ) => {
313
315
this . completionDeferred . resolve ( ) ;
314
316
} ;
315
- this . transaction . onabort = ( ) => {
317
+ this . transaction . onabort = ( event ) => {
318
+ log . error ( 'transaction onabort called' , transaction . error ) ;
316
319
if ( transaction . error ) {
317
320
this . completionDeferred . reject ( transaction . error ) ;
318
321
} else {
@@ -329,6 +332,7 @@ export class SimpleDbTransaction {
329
332
}
330
333
331
334
abort ( error ?: Error ) : void {
335
+ log . error ( 'SimpleDbTransaction.abort() called.' , error ) ;
332
336
if ( error ) {
333
337
this . completionDeferred . reject ( error ) ;
334
338
}
0 commit comments