Utilities to assist with REPL-oriented development.
Utilities to assist with REPL-oriented development.
(-main & args)Installs pretty exceptions, then delegates to clojure.main/main.
Installs pretty exceptions, then delegates to clojure.main/main.
(install-pretty-exceptions)Installs an override that outputs pretty exceptions when caught by the main REPL loop. Also, overrides
clojure.repl/pst, clojure.stacktrace/print-stack-trace, clojure.stacktrace/print-cause-trace.
Extends clojure.core/print-method for type Throwable to print a blank line followed by the
formatted exception. This allows an expression that evaluates to an exception to be printed prettily,
but more importantly, ensures that in clojure.test/is a failed thrown-with-msg? assertion
prints a formatted exception.
Finally, installs an uncaught-exception-handler so that uncaught exceptions in non-REPL threads
will be printed reasonably.
Caught exceptions do not print the stack trace; the pretty replacement for pst does.
Installs an override that outputs pretty exceptions when caught by the main REPL loop. Also, overrides `clojure.repl/pst`, `clojure.stacktrace/print-stack-trace`, `clojure.stacktrace/print-cause-trace`. Extends `clojure.core/print-method` for type Throwable to print a blank line followed by the formatted exception. This allows an expression that evaluates to an exception to be printed prettily, but more importantly, ensures that in `clojure.test/is` a failed `thrown-with-msg?` assertion prints a formatted exception. Finally, installs an [[uncaught-exception-handler]] so that uncaught exceptions in non-REPL threads will be printed reasonably. Caught exceptions do not print the stack trace; the pretty replacement for `pst` does.
(main arg-map)Entrypoint compatible with tools.build. The :fn argument is a symbol that's resolved to a function to invoke, and is passed the argument map.
Entrypoint compatible with tools.build. The :fn argument is a symbol that's resolved to a function to invoke, and is passed the argument map.
(pretty-print-stack-trace tr)(pretty-print-stack-trace tr n)Replacement for clojure.stacktrace/print-stack-trace and print-cause-trace. These functions are used by clojure.test.
Replacement for `clojure.stacktrace/print-stack-trace` and `print-cause-trace`. These functions are used by `clojure.test`.
(pretty-pst)(pretty-pst e-or-depth)(pretty-pst e depth)Used as an override of clojure.repl/pst but uses pretty formatting. Output is written to *err*.
Used as an override of `clojure.repl/pst` but uses pretty formatting. Output is written to `*err*`.
(pretty-repl-caught e)A replacement for clojure.main/repl-caught that prints the exception to *err*, without a stack trace or properties.
A replacement for `clojure.main/repl-caught` that prints the exception to `*err*`, without a stack trace or properties.
(uncaught-exception-handler)Returns a reified UncaughtExceptionHandler that prints the formatted exception to *err*.
Returns a reified UncaughtExceptionHandler that prints the formatted exception to `*err*`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |