Skip to content

Commit 7aa7cfc

Browse files
author
michaellaw
committed
log error.name in transaction failed event
1 parent 10b4648 commit 7aa7cfc

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

src/IndexedDbProvider.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,17 @@ export class IndexedDbTransaction implements DbTransaction {
753753

754754
lockHelper.transactionFailed(
755755
this._transToken,
756-
this._trans.error ??
757-
new Error(
758-
"IndexedDbTransaction OnError, History: " + history.join(",")
759-
)
756+
new Error(
757+
"IndexedDbTransaction OnError" +
758+
(this._trans.error?.name !== undefined
759+
? ", ErrorName: " + this._trans.error.name
760+
: "") +
761+
(this._trans.error?.message !== undefined
762+
? ", ErrorMessage: " + this._trans.error.message
763+
: "") +
764+
", History: " +
765+
history.join(",")
766+
)
760767
);
761768
};
762769

@@ -780,10 +787,17 @@ export class IndexedDbTransaction implements DbTransaction {
780787

781788
lockHelper.transactionFailed(
782789
this._transToken,
783-
this._trans.error ??
784-
new Error(
785-
"IndexedDbTransaction Aborted, History: " + history.join(",")
786-
)
790+
new Error(
791+
"IndexedDbTransaction Aborted" +
792+
(this._trans.error?.name !== undefined
793+
? ", ErrorName: " + this._trans.error.name
794+
: "") +
795+
(this._trans.error?.message !== undefined
796+
? ", ErrorMessage: " + this._trans.error.message
797+
: "") +
798+
", History: " +
799+
history.join(",")
800+
)
787801
);
788802
};
789803
}

0 commit comments

Comments
 (0)