From cd91863abc829c47b15ea1a902e88507efba96ec Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Mon, 3 Aug 2020 14:55:47 +0200 Subject: Be more tolerant of errors with the generic player --- statusbar.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/statusbar.go b/statusbar.go index 47b04f9..8480995 100644 --- a/statusbar.go +++ b/statusbar.go @@ -180,7 +180,7 @@ func (player GenericPlayer) nowPlaying() string { cmd := exec.Command(split[0], args...) out, err := cmd.Output() if err != nil { - panic(err) + return "" } sOut := string(out) sOut = strings.ReplaceAll(sOut, "\n", "") @@ -202,7 +202,7 @@ func (player GenericPlayer) status() int { cmd := exec.Command(split[0], args...) out, err := cmd.Output() if err != nil { - panic(err) + return 2 } sOut := string(out) sOut = strings.ReplaceAll(sOut, "\n", "") -- cgit v1.2.3