Liking cljdoc? Tell your friends :D

conditions.handlers


customclj

(custom f)

Mark a function as a custom handler.

A custom handler is a function (f handlers depth condition normally) that returns a function (f' value).

Mark a function as a custom handler.

A custom handler is a function `(f handlers depth condition normally)` that returns a function `(f' value)`.
sourceraw docstring

defaultclj

(default value)

Handle the condition with a constant value or a simple function of the value.

Handle the condition with a constant value or a simple function of the value.
sourceraw docstring

errorclj

(error message)
(error message ex-data)

Handle a condition by throwing an ex-info

Handle a condition by throwing an ex-info
sourceraw docstring

error*clj

(error* message)
(error* message ex-data)

Handle a condition by throwing an ex-info

Handle a condition by throwing an ex-info
sourceraw docstring

exceptionclj

(exception class message)
(exception class message cause)

Handle a condition by instantiating and throwing an exception of the given class with the given message and cause.

Handle a condition by instantiating and throwing an exception of the given class with the given message and cause.
sourceraw docstring

fall-throughclj

(fall-through f)
(fall-through next-handler f)
(fall-through next-handler f override-normally)

Continue searching for handlers from the parent scope. Similar to handle if it were to always return :continue.

f alters the value (because if you don't need to do anything at this scope you don't need a handler at all)

next-handler acts like remap except that the search still starts at the parent scope

override-normally changes the default handler.

Continue searching for handlers from the parent scope. Similar to `handle` if it were to always return :continue.

f alters the value (because if you don't need to do anything at this scope you don't need a handler at all)

next-handler acts like `remap` except that the search still starts at the parent scope

override-normally changes the default handler.
sourceraw docstring

handleclj

(handle f)

Handle the condition with a simple function of the value.

If the function returns :continue, continue searching handlers from the parent scope.

Handle the condition with a simple function of the value.

If the function returns :continue, continue searching handlers from the parent scope.
sourceraw docstring

optionalclj

Use to indicate that handling a condition is optional. If nothing handles the condition, return the value unmodified.

Use to indicate that handling a condition is optional. If nothing handles the condition, return the value unmodified.
sourceraw docstring

remapclj

(remap next-handler)
(remap next-handler f)
(remap next-handler f override-normally)

Restart the condition handler search from the beginning with a new condition key.

If next-handler is a function, it will be called with the value and the returned value will be the new condition key.

If f is provided, uses the value it returns as the new value for the new condition.

The default handler can also be overridden by providing override-normally.

Restart the condition handler search from the beginning with a new condition key.

If next-handler is a function, it will be called with the value and the returned value will be the new condition key.

If f is provided, uses the value it returns as the new value for the new condition.

The default handler can also be overridden by providing override-normally.
sourceraw docstring

requiredclj

Use to indicate that handling a condition is required. If nothing handles the condition, throw an ex-info.

Use to indicate that handling a condition is required. If nothing handles the condition, throw an ex-info.
sourceraw docstring

siblingclj

(sibling next-handler)
(sibling next-handler f)
(sibling next-handler f override-normally)

Identical to remap except that the search resumes at the current scope.

Identical to `remap` except that the search resumes at the current scope.
sourceraw docstring

traceclj

Just print that something happened and return the value

Just print that something happened and return the value
sourceraw docstring

trace-valueclj

(trace-value message value)

Print a message and return the given value. Ignores any value provided by the restart.

Print a message and return the given value. Ignores any value provided by the restart.
sourceraw docstring

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

× close