« get me outta code hell

Metadata (stored, throttle, status, and more) - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/index.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-02-25 12:06:27 -0400
committerFlorrie <towerofnix@gmail.com>2019-02-25 12:06:27 -0400
commite9ccfa2fd4221ddff4950d5180ee5c8fb0bf8117 (patch)
tree917fb878b8ba0166bb324f3781a756d516a639ca /index.js
parent75251bb2309505c20dc7500117a17649d41412d8 (diff)
Metadata (stored, throttle, status, and more)
Diffstat (limited to 'index.js')
-rwxr-xr-xindex.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/index.js b/index.js
index e46bfa0..6a71611 100755
--- a/index.js
+++ b/index.js
@@ -22,7 +22,16 @@ process.stdout.setMaxListeners(Infinity)
 process.stderr.setMaxListeners(Infinity)
 
 process.on('unhandledRejection', error => {
+  console.error(ansi.setForeground(ansi.C_RED) + "** There was an uncatched error! **" + ansi.resetAttributes())
+  console.error("Don't worry, your music files are all okay.")
+  console.error("This just means there was a bug in mtui.")
+  console.error("In order to verify that the program won't run weirdly, it has stopped.")
+  console.error(ansi.setForeground(ansi.C_RED) + "Error stack:" + ansi.resetAttributes())
   console.error(error.stack)
+  console.error(ansi.setForeground(ansi.C_RED) + "Error object:" + ansi.resetAttributes())
+  console.error(error)
+  console.error("(End of error log.)")
+  process.stdout.write(ansi.cleanCursor())
   process.exit(1)
 })