Skip to content

Commit

Permalink
Add better error reporting for exception monad.
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Jul 4, 2016
1 parent 756cc0e commit f95efcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cats/monad/exception.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@
(success v))

(-mbind [_ s f]
(assert (exception? mv) (str "Context mismatch: " (p/-repr mv)
" is not allowed to use with exception context."))

(if (success? s)
(f (p/-extract s))
s))
Expand Down

0 comments on commit f95efcf

Please sign in to comment.