chore: print a bug reporting notice when crush crashes

Christian Rocha created

All the credit in this revision goes to @andreynering.

Change summary

internal/cmd/root.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

internal/cmd/root.go 🔗

@@ -3,6 +3,7 @@ package cmd
 import (
 	"bytes"
 	"context"
+	"errors"
 	"fmt"
 	"io"
 	"log/slog"
@@ -93,7 +94,7 @@ crush -y
 		if _, err := program.Run(); err != nil {
 			event.Error(err)
 			slog.Error("TUI run error", "error", err)
-			return fmt.Errorf("TUI error: %v", err)
+			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")
 		}
 		return nil
 	},