From 2a3d59523ef55ad7a9741d728fb09d1fef16a544 Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Mon, 10 Jun 2024 16:19:56 +0100 Subject: [PATCH] tweak: throw exception when not given a compatible continuation --- src/utils/re_frame.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/re_frame.cljs b/src/utils/re_frame.cljs index fd123fe8256e..ded7d3c59301 100644 --- a/src/utils/re_frame.cljs +++ b/src/utils/re_frame.cljs @@ -126,4 +126,7 @@ [continuation & args] (cond (vector? continuation) (dispatch (into continuation args)) - (fn? continuation) (apply continuation args))) + (fn? continuation) (apply continuation args) + :else (throw (ex-info + (str "Unsupported continuation: " (type->str continuation)) + {:hint "Make sure to pass a vector or function"}))))