From d9517143a8b84354a7825fc55dc06d7e149765b1 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Fri, 22 Mar 2024 12:17:53 +0100 Subject: [PATCH] [new] Throw compile-time error on signals with both run and error forms --- src/taoensso/telemere/impl.cljc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/taoensso/telemere/impl.cljc b/src/taoensso/telemere/impl.cljc index 06e7668..ceecb85 100644 --- a/src/taoensso/telemere/impl.cljc +++ b/src/taoensso/telemere/impl.cljc @@ -553,6 +553,14 @@ :ctx :parent #_:trace?, :do :let :data :msg :error :run :elide? :allow? #_:expansion-id))] + (when (and run-form error-form) + (throw ; Prevent ambiguity re: source of error + (ex-info "Signals cannot have both `:run` and `:error` opts at the same time" + {:run-form run-form + :error-form error-form + :location location + :other-opts (dissoc opts :run :error)}))) + ;; Eval let bindings AFTER call filtering but BEFORE data, msg `(do ~do-form