summaryrefslogtreecommitdiff
path: root/src/unheard
diff options
context:
space:
mode:
authorJake Zerrer <him@jakezerrer.com>2025-12-09 15:21:15 -0500
committerJake Zerrer <him@jakezerrer.com>2025-12-09 18:02:58 -0500
commit04f953bc2853309c2acbf10254743fc543444c52 (patch)
tree0abf05b306063870eff711ce14b92628dbded09b /src/unheard
parent3ab3079cc173baea9f6e1cf27ca75f959d00cc9e (diff)
Add error logging
Diffstat (limited to 'src/unheard')
-rw-r--r--src/unheard/midi.clj12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/unheard/midi.clj b/src/unheard/midi.clj
index f0debad..c5cf925 100644
--- a/src/unheard/midi.clj
+++ b/src/unheard/midi.clj
@@ -31,6 +31,7 @@
(m/amb))
(m/?< >devices)
(try (m/? m/never)
+ (catch Exception e (println "EEE" e) (throw e))
(finally
(m/? (m/via
m/blk
@@ -69,6 +70,7 @@
:id :midi/device-opened,
:data {:device (str device)}})
(m/? (tfn device))
+ (catch Exception e (println "EEE" e) (throw e))
(finally (log/log! {:level :info, :id :midi/closing-device})
;; NOTE:
;; Be careful, (.close device) will wait for (.send
@@ -124,6 +126,7 @@
:data {:value (str v)}})
v)
(recur)))))))
+ (catch Exception e (println "EEE" e) (throw e))
(finally (log/log! {:level :info, :id :midi/closing-tx})
(m/? (m/via m/blk (.close transmitter)))
(log/log! {:level :info, :id :midi/tx-closed}))))))
@@ -154,6 +157,7 @@
(.send receiver v UNSCHEDULED-EVENT)))
(log/log! {:level :debug,
:id :midi/send-returned})))))
+ (catch Exception e (println "EEE" e) (throw e))
(finally (log/log! {:level :info, :id :midi/closing-rx})
(m/? (m/via m/blk (.close receiver)))
(log/log! {:level :info, :id :midi/rx-closed}))))))
@@ -281,10 +285,10 @@
short-messages (atom nil)
>short-messages (m/watch short-messages)]
(m/amb= (do (reset! short-messages nil)
- (m/? (<bus device-name
- (fn [v]
- (m/ap (try
- (let [msg (m/?< v)]
+ (m/?
+ (<bus device-name
+ (fn [v]
+ (m/ap (try (let [msg (m/?< v)]
(reset! short-messages msg))
(catch missionary.Cancelled c
;; When the upstream flow is