Introduce `panicTrace` and `errorTrace`
This MR does two things:
- It introduces (and exports) the
panicTrace
anderrorTrace
functions in our Prelude, to be used as a drop-in replacement forpanic
anderror
. The glaring advantage is that they allow attaching a stacktrace of where the exception originated.
Compare, using panic in gargPassUserEasy'
:
Conversely, if we use panicTrace instead:
Now we know exactly where the error originated.
- I have re-exported the original
panic
anderror
but I have marked them with theDEPRECATED
pragma, so that if we compilegargantext
and we still have instances ofpanic
anderror
in the codebase, GHC will warn us (and stop compilation if-Werror
is used):