Permalink
Browse files

Update instructions to use try/catch in init.clj. Fixes #6

  • Loading branch information...
1 parent 0c424a5 commit 2e3db37c852c4a02b5f164d3d92410a4ac9db904 @technomancy technomancy committed Nov 2, 2011
Showing with 13 additions and 9 deletions.
  1. +13 −9 README.md
View
22 README.md
@@ -38,22 +38,26 @@ If you want to direct the printing to somewhere other than `*out*`, either use `
The library also offers an API for programatically 'parsing' exceptions. This API is used internal for `pst` and can be used to e.g. improve development tools. Try for example:
- => (use '(clj-stacktrace core))
- => (try
- ("nofn")
- (catch Exception e
- (parse-exception e)))
+```clj
+(use '(clj-stacktrace core))
+(try
+ ("nofn")
+ (catch Exception e
+ (parse-exception e)))
+```
If you use Leiningen, you can install clj-stacktrace on a per-user basis:
$ lein plugin install clj-stacktrace 0.2.3
Add this to your `~/.lein/init.clj` file:
- (require 'leiningen.hooks.clj-stacktrace-test)
-
- (def settings {:repl-options [:init (require 'clj-stacktrace.repl)
- :caught 'clj-stacktrace.repl/pst+]})
+```clj
+(try (require 'leiningen.hooks.clj-stacktrace-test)
+ (def settings {:repl-options [:init (require 'clj-stacktrace.repl)
+ :caught 'clj-stacktrace.repl/pst+]})
+ (catch java.io.FileNotFoundException _))
+```
The hook will enable clj-stacktrace to be used across all the projects
you work on in clojure.test and other things that use the

0 comments on commit 2e3db37

Please sign in to comment.