Liking cljdoc? Tell your friends :D

slingshot.support


*catch-hook*clj

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 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.
raw docstring

*throw-hook*clj

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.
raw docstring

appears-within?clj

(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
raw docstring

default-throw-hookclj

(default-throw-hook context)

Default implementation of throw-hook

Default implementation of *throw-hook*
raw docstring

gen-catchclj

(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.
raw docstring

gen-finallyclj

(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
raw docstring

get-contextclj

(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.
raw docstring

get-throwableclj

(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
raw docstring

make-contextclj

(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
raw docstring

parse-throw+clj

(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+
raw docstring

parse-try+clj

(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
raw docstring

resolve-localcljmacro

(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
raw docstring

rethrowcljmacro

(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
raw docstring

stack-traceclj

(stack-trace)

Returns the current stack trace beginning at the caller's frame

Returns the current stack trace beginning at the caller's frame
raw docstring

throw-argclj

(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
raw docstring

throw-fnclj

(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+
raw docstring

unwrapclj

(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
raw docstring

unwrap-allclj

(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.
raw docstring

wrapclj

(wrap {:keys [object message cause stack-trace]})

Returns a context wrapper given a context

Returns a context wrapper given a context
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close