Skip to content

Commit 5efde9f

Browse files
committed
fix(nav): fake send on closed channel message (316)
1 parent 2d12e4f commit 5efde9f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

xfs/nav/navigator-abstract.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ func (n *navigator) ensync(frame *navigationFrame, ai *AsyncInfo) {
2626
Label: "boost decorator",
2727
Fn: func(item *TraverseItem) error {
2828
defer func() {
29-
pe := recover()
30-
if err, ok := pe.(error); !ok || !strings.Contains(err.Error(),
31-
"send on closed channel") {
32-
fmt.Printf("---> ☠️☠️☠️ ENSYNC-NAV-CALLBACK(panic on close): '%v' (err:'%v')\n",
33-
item.Path, pe,
34-
)
29+
if pe := recover(); pe != nil {
30+
if err, ok := pe.(error); ok || strings.Contains(err.Error(),
31+
"send on closed channel") {
32+
fmt.Printf("---> ☠️☠️☠️ ENSYNC-NAV-CALLBACK(panic on close): '%v' (err:'%v')\n",
33+
item.Path, pe,
34+
)
35+
} else {
36+
// Let panic propagate to whoever can handle it
37+
//
38+
panic(pe)
39+
}
3540
}
3641
}()
3742
fmt.Printf("---> 🐬 ENSYNC-NAV-CALLBACK: '%v' \n", item.Path)

0 commit comments

Comments
 (0)