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 e0a84b5 commit 72cfc74Copy full SHA for 72cfc74
package/src/operations/transaction.ts
@@ -79,16 +79,15 @@ export const transaction = async <Result = void>(
79
80
return result
81
} catch (executionError) {
82
- if (isFinalized) {
83
- throw NitroSQLiteError.fromError(executionError)
+ if (!isFinalized) {
+ try {
84
+ rollback()
85
+ } catch (rollbackError) {
86
+ throw NitroSQLiteError.fromError(rollbackError)
87
+ }
88
}
89
- try {
- rollback()
- return undefined as Result
- } catch (rollbackError) {
90
- throw NitroSQLiteError.fromError(rollbackError)
91
- }
+ throw NitroSQLiteError.fromError(executionError)
92
93
})
94
0 commit comments