WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 26886fc

Browse files
committed
fixes original issue 53
Signed-off-by: Sean Corfield <[email protected]>
1 parent 5145908 commit 26886fc

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* v0.13.next in progress
44
* address [clj-commons/slingshot#4](https://github.com/clj-commons/slingshot/issues/4) by merging stacktrace changes from [a20748f](https://github.com/clj-commons/slingshot/commit/a20748fd2d6d4a9020d296a3798e82f136e2bfe2) by [@scgilardi](https://github.com/scgilardi).
55
* address [clj-commons/slingshot#3](https://github.com/clj-commons/slingshot/issues/3) by merging `and` optimizations from original PR [#55](https://github.com/scgilardi/slingshot/pull/55) by [@jbouwman](https://github.com/jbouwman).
6+
* address [scgilardo/slingshot#53](https://github.com/scgilardi/slingshot/issues/53) by adding examples of `else` and `finally`.
67

78
* v0.13.0 -- 2025-09-20
89
- add clj-kondo config export

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,25 @@ caught {:value 5} {:object {:value 5}, :message important message, :cause nil,
146146
side effects) immediately after the code in the `try+` body
147147
completes only if nothing was thrown.
148148

149+
```clojure
150+
(try+
151+
(throw+ "Boom!")
152+
(catch string? s (println "caught string:" s))
153+
(else (println "no exception"))
154+
(finally (println "always prints!")))
155+
;; caught string: Boom!
156+
;; always prints!
157+
158+
159+
(try+
160+
"Success!"
161+
(catch string? s (println "caught string:" s))
162+
(else (println "no exception"))
163+
(finally (println "always prints!")))
164+
;; no exception
165+
;; always prints!
166+
```
167+
149168
Usage
150169
-----
151170

0 commit comments

Comments
 (0)