« get me outta code hell

Error handling stuff - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-06-13 21:03:30 -0300
committerFlorrie <towerofnix@gmail.com>2018-06-13 21:03:30 -0300
commit3c0cd5c2a98685ab9fd0fdf97a1ac28ceb97dc74 (patch)
tree564dfa43da134f10cfaae9405a5152e3316ba51d /ui.js
parent4de13b1d3e1cff28e331607b262513a9583aa08a (diff)
Error handling stuff
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index ac86a47..371958d 100644
--- a/ui.js
+++ b/ui.js
@@ -95,9 +95,18 @@ class AppElement extends FocusElement {
 
   async setup() {
     this.player = await getPlayer()
+
+    if (!this.player) {
+      return {
+        error: "Sorry, it doesn't look like there's an audio player installed on your computer. Can you try installing MPV (https://mpv.io) or SoX?"
+      }
+    }
+
     this.player.on('printStatusLine', data => {
       this.playbackInfoElement.updateProgress(data)
     })
+
+    return true
   }
 
   async shutdown() {