Closed philomates closed 7 years ago
It would be cool if users could customize the exception handler.
@rafaeldff regarding https://github.com/marick/Midje/pull/402#issuecomment-327527547 for now I'm just going to create a :pretty-print
config flag that is by default set to true
, but when set to false
defaults to the old way of formatting exceptions (in case anyone doesn't like the change).
I also use the :pretty-print
in this PR https://github.com/marick/Midje/pull/404 to turn of pretty printing of expected output
This isn't ideal or very configurable, so I will look into allowing custom exception handlers in the future.
For now I ran into some issues trying to implement that: I tried basing my plugin system on protocols and ran into issues of reloading protocol definitions and trying to use them with old instances (due to how midje reloads code on changes). So I tried to fix how midje reloads changes using clojure.tools.namespaces
but ran into more issues. I'm going to keep poking at it, but I want to get this out in the meantime.
The error messages shown when midje fails to load files at autotest startup only show the exception's message. Hence, useful error information that is in the exception's data (in the case of
clojure.lang.ExceptionInfo
) or exceptions with nested causing exceptions, is hidden.Before:
After:
Also currently the exceptions printed on load failures when doing a
(load-facts)
from the repl looks like this:This PR updates it to look like this