We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26e1566 commit b788cecCopy full SHA for b788cec
lib/index.ts
@@ -555,7 +555,14 @@ export default class Database {
555
commit.run();
556
return result;
557
} catch (error) {
558
- rollback.run();
+ try {
559
+ rollback.run();
560
+ } catch (rollbackError) {
561
+ if (rollbackError instanceof Error) {
562
+ rollbackError.cause = error;
563
+ }
564
+ throw rollbackError;
565
566
throw error;
567
} finally {
568
this.#transactionDepth -= 1;
0 commit comments