Skip to content

Commit

Permalink
Fail promise with the same exception as canceled future
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Sierra committed Nov 30, 2012
1 parent 068aace commit 9ec014a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cljque/promises.clj
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@
(isDone [_] (.isDone fut))
(cancel [_ interrupt?]
(let [b (.cancel fut interrupt?)]
(when b (fail return (CancellationException.)))
(when b (fail return (try (.get fut)
(CancellationException.)
(catch Throwable t t))))
b))
INotify
(-attend [_ f executor]
Expand Down

0 comments on commit 9ec014a

Please sign in to comment.