Skip to content

Commit fc35f95

Browse files
committed
Adds go-loop variante with exception handling
1 parent 2df07dd commit fc35f95

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/jtk_dvlp/async.cljc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
(catch Throwable e#
4747
(ex-info "error" {:error :unknown} e#)))))))
4848

49+
#?(:clj
50+
(defmacro go-loop*
51+
"Like `go-loop` but carries thrown `ExceptionInfo` as result.
52+
53+
Usage in combination with `<e!`, `<p!` and `<cb!`."
54+
[bindings & body]
55+
`(go* (loop ~bindings ~@body))))
56+
4957
#?(:clj
5058
(defmacro <e!
5159
"Like `<!` but tests taken val instance of `ExceptionInfo`, if so throws it.

0 commit comments

Comments
 (0)