Skip to content

Commit b8881ad

Browse files
committed
Describe how to use nREPL middleware
1 parent 03b910c commit b8881ad

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ The related function, `format-exception`, produces the same output, but returns
149149

150150
For both `format-exception` and `write-exception`, output of the stack trace is optional.
151151

152+
# REPL and nREPL Support
153+
154+
To enable pretty exceptions when using the REPL under [Leinigen](https://github.com/technomancy/leiningen), add the following
155+
to your project (or to `~/.lein/profiles.clj`):
156+
157+
```clojure
158+
:repl-options {
159+
:nrepl-middleware [io.aviso.nrepl/pretty-middleware]
160+
}
161+
```
162+
163+
This adds nREPL middleware to enable pretty exception reporting. When exceptions occur in the REPL, they are printed out
164+
without a stack trace. The `clojure.repl/pst` function is overridden to print the exception _with_ a stack trace.
165+
152166
# io.aviso.columns
153167

154168
The columns namespace is what's used by the exceptions namespace to format the exceptions, properties, and stack

0 commit comments

Comments
 (0)