Skip to content

Commit 6dda7e7

Browse files
authored
Merge pull request #236 from caioaao/fix-exc-monad
Fix exception monad to catch any throwable instead of only exceptions
2 parents 533c5a7 + 51a5491 commit 6dda7e7

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog #
22

3+
## Version 2.3.5
4+
5+
Date: 2020-02-21
6+
7+
- Change exception monad to catch all throwables instead of exceptions only
8+
39
## Version 2.3.4
410

511
Date: 2020-02-11

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject funcool/cats "2.3.4"
1+
(defproject funcool/cats "2.3.5"
22
:description "Category Theory abstractions for Clojure"
33
:url "https://github.com/funcool/cats"
44
:license {:name "BSD (2 Clause)"

src/cats/monad/exception.cljc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"Return true if `v` is an instance of
7474
the Throwable or js/Error type."
7575
[e]
76-
(instance? #?(:clj Exception :cljs js/Error) e))
76+
(instance? #?(:clj Throwable :cljs js/Error) e))
7777

7878
;; --- Types and implementations.
7979

@@ -199,7 +199,7 @@
199199
(throwable? result) (failure result)
200200
(exception? result) result
201201
:else (success result)))
202-
(catch #?(:clj Exception
202+
(catch #?(:clj Throwable
203203
:cljs js/Error) e (failure e))))
204204

205205
(defn ^{:no-doc true}

0 commit comments

Comments
 (0)