Skip to content

Commit

Permalink
Update docs for in-context fn
Browse files Browse the repository at this point in the history
  • Loading branch information
FieryCod committed Feb 5, 2022
1 parent bde3428 commit aad552d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/fierycod/holy_lambda/agent.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
(def ^:private AGENT_EXECUTOR "native-agent")

(defmacro in-context
"Executes body in safe agent context for native configuration generation. See docs for more."
"Executes body in safe agent context for native configuration generation.
Catches all errors thrown during execution."
[& body]
(if-not (System/getenv "USE_AGENT_CONTEXT")
nil
`(when (= (System/getProperty "executor") @#'fierycod.holy-lambda.agent/AGENT_EXECUTOR)
(try (do ~@body)
(catch Exception err#
(println "Exception in agent-context: " err#))))))
(try
(do ~@body)
(catch Exception err#
(println "Exception in agent-context: " err#))))))

(defn- agents-payloads->invoke-map
[]
Expand Down

0 comments on commit aad552d

Please sign in to comment.