on main help sign in
chore: print a bug reporting notice when crush crashes
75a602aChristian Rocha
internal/cmd/root.go+2−1
@@ -3,6 +3,7 @@ package cmd
3import (
3import (
4 "bytes"
4 "bytes"
5 "context"
5 "context"
6+ "errors"
6 "fmt"
7 "fmt"
7 "io"
8 "io"
8 "log/slog"
9 "log/slog"
@@ -93,7 +94,7 @@ crush -y
93 if _, err := program.Run(); err != nil {
94 if _, err := program.Run(); err != nil {
94 event.Error(err)
95 event.Error(err)
95 slog.Error("TUI run error", "error", err)
96 slog.Error("TUI run error", "error", err)
96− return fmt.Errorf("TUI error: %v", err)
97+ return errors.New("Crush crashed. If metrics are enabled, we were notified about it. If you'd like to report it, please copy the stacktrace above and open an issue at https://github.com/charmbracelet/crush/issues/new?template=bug.yml")
97 }
98 }
98 return nil
99 return nil
99 },
100 },