Liking cljdoc? Tell your friends :D

clj-commons.pretty.repl

Utilities to assist with REPL-oriented development.

Utilities to assist with REPL-oriented development.
raw docstring

-mainclj

(-main & args)

Installs pretty exceptions, then delegates to clojure.main/main.

Installs pretty exceptions, then delegates to clojure.main/main.
sourceraw docstring

install-pretty-exceptionsclj

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

pretty-print-stack-traceclj

(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`.
sourceraw docstring

pretty-pstclj

(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*`.
sourceraw docstring

pretty-repl-caughtclj

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

uncaught-exception-handlerclj

(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*`.
sourceraw docstring

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

× close