File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 33
33
34
34
#?(:clj
35
35
(defmacro go
36
- " Like `core.async/go` but carries thrown error / exception as result."
36
+ " Like `core.async/go` but carries thrown exception (will convert to `ExceptionInfo`) as result."
37
37
[& body]
38
38
(if (:ns &env)
39
39
`(cljs.core.async/go
53
53
54
54
#?(:clj
55
55
(defmacro go-loop
56
- " Like `core.async/go-loop` but carries thrown error / exception as result."
56
+ " Like `core.async/go-loop` but carries thrown exception (will convert to `ExceptionInfo`) as result."
57
57
[bindings & body]
58
58
`(jtk-dvlp.async/go
59
59
(loop ~bindings
60
60
~@body))))
61
61
62
62
#?(:clj
63
63
(defmacro <!
64
- " Like `core.async/<!` but tests taken val of error / exception, if so throws it."
64
+ " Like `core.async/<!` but tests taken val of exception (`ExceptionInfo`) , if so throws it."
65
65
[?exp]
66
66
(if (:ns &env)
67
67
`(let [v# (cljs.core.async/<! ~?exp)]
83
83
v#))))
84
84
85
85
(defn map
86
- " Like `core.async/map` but carries thrown error / exception as result."
86
+ " Like `core.async/map` but carries thrown exception (will convert to `ExceptionInfo`) as result."
87
87
[f chs]
88
88
(async/map
89
89
(fn [& args]
98
98
chs))
99
99
100
100
(defn reduce
101
- " Like `core.async/reduce` but carries thrown error / exception as result."
101
+ " Like `core.async/reduce` but carries thrown exception (will convert to `ExceptionInfo`) as result."
102
102
[f init ch]
103
103
(async/reduce
104
104
(fn [accu v]
113
113
init ch))
114
114
115
115
(defn into
116
- " Like `core.async/into` but carries thrown error / exception as result."
116
+ " Like `core.async/into` but carries thrown exception (will convert to `ExceptionInfo`) as result."
117
117
[coll ch]
118
118
(reduce conj coll ch))
Original file line number Diff line number Diff line change 56
56
57
57
(defn c->p
58
58
" Creates a promise and resolves it with the val of channel `c`
59
- taken by `<!` or rejects it on error / exception. Closes the channel after took val."
59
+ taken by `<!` or rejects it on exception (`ExceptionInfo`) . Closes the channel after took val."
60
60
[c]
61
61
(create-promise
62
62
(fn [resolve reject]
73
73
Given function `f` can be used to fill the promise.
74
74
`f` will be called with one arg functions `resolve` and `reject`
75
75
to resolve or reject the created promise. Rejection value will
76
- will be used as `ex-info` `cause`."
76
+ be wrapped in `ExceptionInfo` as `cause`."
77
77
([]
78
78
(async/promise-chan ))
79
79
You can’t perform that action at this time.
0 commit comments