Clojure error handling
Currently only implements try-let
which keeps the bindings even in the catch
and finally
clauses.*
* Not necessarily a good idea
(try-let [a (create-a)
b (create-b a)]
(create-c b)
(catch Exception e
(when b (close b))
(when a (close a))
(throw e))
(finally
(println "a:" a "b:" b)))
See tests for more examples.
Internally implements clojure.lang.IExceptionInfo that doesn't write the stacktrace, which is a part from fmnoise/flow
Copyright © 2020 Yonatan Elhanan
Distributed under the MIT License