Liking cljdoc? Tell your friends :D

nrepl.middleware.caught

Support for a hook for conveying errors interactively, akin to the :caught option of clojure.main/repl. See the docstring of wrap-caught and the Evaluation Errors section of the Middleware documentation for more information.

Support for a hook for conveying errors interactively, akin to the `:caught`
option of `clojure.main/repl`. See the docstring of `wrap-caught` and the
Evaluation Errors section of the Middleware documentation for more
information.

*caught-fn*

Function to use to convey interactive errors (generally by printing to *err*). Takes one argument, a java.lang.Throwable.

Function to use to convey interactive errors (generally by printing to
`*err*`). Takes one argument, a `java.lang.Throwable`.
sourceraw docstring

configuration-keys

source

default-bindings

source

wrap-caught

(wrap-caught handler)

Middleware that provides a hook for any java.lang.Throwable that should be conveyed interactively (generally by printing to *err*).

Returns a handler which calls said hook on the ::caught/throwable slot of messages sent via the request's transport.

Supports the following options:

  • ::caught – a fully-qualified symbol naming a var whose function to use to convey interactive errors. Must point to a function that takes a java.lang.Throwable as its sole argument.

  • ::caught-fn – the function to use to convey interactive errors. Will be resolved from the above option if provided. Defaults to clojure.main/repl-caught. Must take a java.lang.Throwable as its sole argument.

  • ::print? – if logical true, the printed value of any interactive errors will be returned in the response (otherwise they will be elided). Delegates to nrepl.middleware.print to perform the printing. Defaults to false.

The options may be specified in either the request or the responses sent on its transport. If any options are specified in both, those in the request will be preferred.

Middleware that provides a hook for any `java.lang.Throwable` that should be
conveyed interactively (generally by printing to `*err*`).

Returns a handler which calls said hook on the `::caught/throwable` slot of
messages sent via the request's transport.

Supports the following options:

* `::caught` – a fully-qualified symbol naming a var whose function to use to
convey interactive errors. Must point to a function that takes a
`java.lang.Throwable` as its sole argument.

* `::caught-fn` – the function to use to convey interactive errors. Will be
resolved from the above option if provided. Defaults to
`clojure.main/repl-caught`. Must take a `java.lang.Throwable` as its sole
argument.

* `::print?` – if logical true, the printed value of any interactive errors
will be returned in the response (otherwise they will be elided). Delegates to
`nrepl.middleware.print` to perform the printing. Defaults to false.

The options may be specified in either the request or the responses sent on
its transport. If any options are specified in both, those in the request will
be preferred.
sourceraw docstring

wrap-caught-optional-arguments

source

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

× close