~bigbes/core-go: 209e1a86

database/middleware: do not recover/panic in defer

defer always runs after a panic. There is no need to recover and
re-panic, we can just unconditionally tx.Rollback() (it will
silently error out if the transaction has already been committed or
rolled back).

This fixes the stack trace of the panic being incorrect. It points
to this function instead of the real culprit.

Simon Ser <contact@emersion.fr> — 2023-03-24 12:05:58 UTC

Commit 209e1a86985183fbd680f052f4db8a49efea2120view raw patch

Parent(s): 1f6fac1d

1 changed file(s)

FileStatus+
database/middleware.go M +1 -6