Skip to content

Commit ac2f078

Browse files
authored
chore(store): capture stacktrace on recover (#349)
Otherwise, we don't know what's actually happened.
1 parent 09cbe26 commit ac2f078

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

store/store_delete.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"runtime"
8+
"runtime/debug"
89
"slices"
910
"sync"
1011
"time"
@@ -24,9 +25,10 @@ func (s *Store[H]) OnDelete(fn func(context.Context, uint64) error) {
2425
err := recover()
2526
if err != nil {
2627
rerr = fmt.Errorf(
27-
"header/store: user provided onDelete panicked on %d with: %s",
28+
"user provided onDelete panicked on %d with: %s\n%s",
2829
height,
2930
err,
31+
string(debug.Stack()),
3032
)
3133
}
3234
}()

0 commit comments

Comments
 (0)