Skip to content

Commit

Permalink
Use propagate instead of re-throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
swlkr committed Mar 3, 2020
1 parent 2773b83 commit e8fbd66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/joy/helper.janet
Expand Up @@ -81,12 +81,12 @@
(defmacro rescue [f &opt id]
~(try
[nil ,f]
([err]
([err fib]
(if (and (dictionary? err)
(or (truthy? (get err :id))
(= ,id (get err :id))))
[(get err :error) nil]
(error err)))))
(propagate err fib)))))


(defmacro rescue-from [id f]
Expand Down

0 comments on commit e8fbd66

Please sign in to comment.