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*
(gen-catch catch-clauses throw-sym threw?-sym)
Transforms a seq of catch clauses for try+ into a list containing 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 list containing 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.
(gen-finally else-clause finally-clause threw?-sym)
Returns either nil or a list containing a finally clause for a try form based on the parsed else and/or finally clause from a try+ form
Returns either nil or a list containing a finally clause for a try form based on the parsed else and/or finally clause from a try+ form
(get-context t)
Returns a context given a Throwable t. If t or any Throwable in its cause chain is a context wrapper or other IExceptionInfo, returns the corresponding 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 or other IExceptionInfo, returns the corresponding 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 cause stack-trace)
Makes a throw context from a throwable or explicit arguments
Makes a throw context from a throwable or explicit arguments
(parse-throw+ object cause & args)
Returns a vector containing the message and cause that result from processing the arguments to throw+
Returns a vector containing the message and cause that result from processing the arguments to throw+
(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
(resolve-local sym)
Expands to sym if it names a local in the current environment or nil otherwise
Expands to sym if it names a local in the current environment or nil otherwise
(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-fn object {cause :throwable} stack-trace & args)
Helper to throw a context based on arguments and &env from throw+
Helper to throw a context based on arguments and &env from throw+
(unwrap t)
If t is a context wrapper or other IExceptionInfo, returns the corresponding context with t assoc'd as the value for :wrapper, else returns nil
If t is a context wrapper or other IExceptionInfo, returns the corresponding 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 or other IExceptionInfo. If one is found, returns the corresponding 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 or other IExceptionInfo. If one is found, returns the corresponding context with the wrapper assoc'd as the value for :wrapper, else returns nil.
(wrap {:keys [object message cause stack-trace]})
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