Skip to content

Commit d524099

Browse files
committed
fix: rethrow errors in asyncly
Fix an issue where `asyncly` could silently catch errors, and if no default error handler was set we would never see them.
1 parent fb213a3 commit d524099

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tapestry/core.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@
284284
@(s/put! result (f %))
285285
(catch Exception e
286286
(when on-error
287-
(on-error e "Exception in asyncly function")))
287+
(on-error e "Exception in asyncly function"))
288+
(throw e))
288289
(finally
289290
(.arriveAndDeregister phaser)))))
290291
s)
@@ -315,7 +316,8 @@
315316
@(s/put! result (f val))
316317
(catch Exception e
317318
(when on-error
318-
(on-error e "Error in asyncly callback"))))
319+
(on-error e "Error in asyncly callback"))
320+
(throw e)))
319321
(recur))))))
320322
(s/on-drained work-buffer #(fiber (.arriveAndDeregister phaser)
321323
(.awaitAdvance phaser 0)

0 commit comments

Comments
 (0)