Hook to allow overriding the behavior of catch. Must be bound to a function of one argument, a context map. Returns a (possibly modified) context map to be considered by catch clauses.
Normal processing by catch clauses can be skipped by adding special keys to the context map:
If the context contains the key:
Defaults to identity.
Hook to allow overriding the behavior of catch. Must be bound to a function of one argument, a context map. Returns a (possibly modified) context map to be considered by catch clauses. Normal processing by catch clauses can be skipped by adding special keys to the context map: If the context contains the key: - :catch-hook-return, try+ will return the corresponding value; - :catch-hook-throw, try+ will throw+ the corresponding value; - :catch-hook-rethrow, try+ will rethrow the caught object's outermost wrapper. Defaults to identity.
Hook to allow overriding the behavior of throw+. Must be bound to a function of one argument, a context map. Defaults to default-throw-hook.
Hook to allow overriding the behavior of throw+. Must be bound to a function of one argument, a context map. Defaults to default-throw-hook.
(appears-within? x coll)
Returns true if x appears within coll at any nesting depth
Returns true if x appears within coll at any nesting depth
(default-throw-hook context)
Default implementation of throw-hook
Default implementation of *throw-hook*
(environment)
Expands to code that generates a map of locals: names to values
Expands to code that generates a map of locals: names to values
(get-context t)
Returns a context given a Throwable t. If t or any Throwable in its cause chain is a context wrapper, returns the context with the wrapper assoc'd as the value for :wrapper and t assoc'd as the value for :throwable. Otherwise creates a new context based on t with t assoc'd as the value for :throwable.
Returns a context given a Throwable t. If t or any Throwable in its cause chain is a context wrapper, returns the context with the wrapper assoc'd as the value for :wrapper and t assoc'd as the value for :throwable. Otherwise creates a new context based on t with t assoc'd as the value for :throwable.
(get-throwable {object :object :as context})
Returns a Throwable given a context: the object in context if it's a Throwable, else a Throwable context wrapper
Returns a Throwable given a context: the object in context if it's a Throwable, else a Throwable context wrapper
(make-context t)
(make-context object message stack-trace environment)
Makes a throw context from arguments. Captures the cause from the environment argument if present.
Makes a throw context from arguments. Captures the cause from the environment argument if present.
(parse-try+ body)
Returns a vector of seqs containing the expressions, catch clauses, and finally clauses in a try+ body, or throws if the body's structure is invalid
Returns a vector of seqs containing the expressions, catch clauses, and finally clauses in a try+ body, or throws if the body's structure is invalid
(rethrow)
Within a try+ catch clause, throws the outermost wrapper of the caught object
Within a try+ catch clause, throws the outermost wrapper of the caught object
(stack-trace)
Returns the current stack trace beginning at the caller's frame
Returns the current stack trace beginning at the caller's frame
(throw-arg fmt & args)
Throws an IllegalArgumentException with a message given arguments for clojure.core/format
Throws an IllegalArgumentException with a message given arguments for clojure.core/format
(throw-context object message stack-trace environment)
Throws a context. Allows overrides of throw-hook to intervene.
Throws a context. Allows overrides of *throw-hook* to intervene.
(transform-catch catch-clauses throw-sym)
Transforms a seq of catch clauses for try+ into a seq of one catch clause for try that implements the specified behavior. throw-sym names a macro or function (usually throw+) that can accept zero or one arguments. It is called with one argument for :catch-hook-throw requests, or zero arguments for :catch-hook-rethrow requests or when no try+ catch clause matches.
Transforms a seq of catch clauses for try+ into a seq of one catch clause for try that implements the specified behavior. throw-sym names a macro or function (usually throw+) that can accept zero or one arguments. It is called with one argument for :catch-hook-throw requests, or zero arguments for :catch-hook-rethrow requests or when no try+ catch clause matches.
(unwrap t)
If t is a context wrapper, returns the context with t assoc'd as the value for :wrapper, else returns nil
If t is a context wrapper, returns the context with t assoc'd as the value for :wrapper, else returns nil
(unwrap-all t)
Searches Throwable t and its cause chain for a context wrapper. If one is found, returns the context with the wrapper assoc'd as the value for :wrapper, else returns nil.
Searches Throwable t and its cause chain for a context wrapper. If one is found, returns the context with the wrapper assoc'd as the value for :wrapper, else returns nil.
(wrap context)
Returns a context wrapper given a context
Returns a context wrapper given a context
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close