Public Vars

Back

with-postmortem (clj)

(source)

macro

(with-postmortem driver opts & body)
Executes `body` with postmortem handling. Good for forensics. If an exception occurs, saves: - screenshot `.png` to `:dir-img` else `:dir` else current working directory - page source `.html` to `:dir-scr` else `:dir` else current working directory - console log `.json` to `:dir-log` else `:dir` else current working directory Dirs are automatically created if necessary. `:date-format` used in filename to keep them unique. See Java SDK `SimpleDateFormat` for available patterns. Defaults to `"yyyy-MM-dd-HH-mm-ss"`. Tip: don't bother using `with-postmortem` in test fixtures. The standard `clojure.test`framework has its own way of handling exceptions, so wrapping a fixture with `(with-postmortem...)` would be in vain.

Examples