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.
1 files changed, 1 insertions(+), 6 deletions(-) M database/middleware.go
M database/middleware.go => database/middleware.go +1 -6