Created
September 10, 2013 03:43
-
-
Save arohner/6504697 to your computer and use it in GitHub Desktop.
(try+ true)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (try | |
| true | |
| (catch | |
| java.lang.Throwable | |
| &throw-context | |
| (clojure.core/let [&throw-context (clojure.core/-> | |
| &throw-context | |
| slingshot.support/get-context | |
| slingshot.support/*catch-hook*)] | |
| (clojure.core/cond | |
| (clojure.core/contains? &throw-context :catch-hook-return) (:catch-hook-return | |
| &throw-context) | |
| (clojure.core/contains? &throw-context :catch-hook-throw) (slingshot.slingshot/throw+ | |
| (:catch-hook-throw | |
| &throw-context)) | |
| (clojure.core/contains? &throw-context :catch-hook-rethrow) (slingshot.slingshot/throw+) | |
| :else (slingshot.slingshot/throw+))))) |
arohner
commented
Sep 10, 2013
Author
Author
expansion for
(try+
true
(catch bar t
(t/print-env "throw-context")
false))(try
true
(catch
java.lang.Throwable
&throw-context
(clojure.core/let [&throw-context (clojure.core/->
&throw-context
slingshot.support/get-context
slingshot.support/*catch-hook*)]
(clojure.core/cond
(clojure.core/contains? &throw-context :catch-hook-return) (:catch-hook-return
&throw-context)
(clojure.core/contains? &throw-context :catch-hook-throw) (slingshot.slingshot/throw+
(:catch-hook-throw
&throw-context))
(clojure.core/contains? &throw-context :catch-hook-rethrow) (slingshot.slingshot/throw+)
(bar (:object &throw-context)) (clojure.core/let
[t (:object &throw-context)]
(t/print-env "throw-context")
false)
:else (slingshot.slingshot/throw+)))))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment