summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst92@gmail.com>2020-08-03 14:55:47 +0200
committerJulian Hurst <julian.hurst92@gmail.com>2020-08-03 14:55:47 +0200
commitcd91863abc829c47b15ea1a902e88507efba96ec (patch)
tree714d5e43e58933c2b5278ec048c9655cbcd40d9e
parent9b836710ad52ea06a84e919774e612170bf03292 (diff)
downloadstatusbar-cd91863abc829c47b15ea1a902e88507efba96ec.tar.gz
Be more tolerant of errors with the generic player
-rw-r--r--statusbar.go4
1 files 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", "")