You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would be glad if you write an example how to use failjure for cases, where a user needs to close opened resources in any case. E.g. I’m doing the next:
(f/attempt-all [reader (pdf-reader source)
document (pdf-document reader)
fields (fields document)]
(do
(.close document)
(.close reader)
fields)
(f/when-fail [e]
; Here I do not have an access to reader and document
; to close them
))
I wonder if there any mechanism to close the document and the reader in any case, like with with-open
The text was updated successfully, but these errors were encountered:
Thanks for the sample! It seems to me that a monad-based solution would be the way to go, but that would probably require enough interop with algo.monads that failjure wouldn't be adding much (also, algo.monads doesn't work on clojurescript, which would be nice to have).
I'll do some experimentation sometime with cats, which is a monad library that does clojurescript too -- maybe a solution will present itself then.
Hello!
First of all, thanks for failjure
I would be glad if you write an example how to use failjure for cases, where a user needs to close opened resources in any case. E.g. I’m doing the next:
I wonder if there any mechanism to close the
document
and thereader
in any case, like withwith-open
The text was updated successfully, but these errors were encountered: