You need to sign in or sign up before continuing.
Display type and callstack of exception on handler
This commit changes the Exception instance of SomeException to *simply* display the underlying exception in `displayException`. The augmented exception message that included the type and backtrace of the exception are now only printed on a call to `displayExceptionWithInfo`. At a surface level, existing programs should behave the same since the `uncaughtExceptionHandler`, which is responsible for printing out uncaught exceptions to the user, will use `displayExceptionWithInfo` by default. However, unlike the instance's `displayException` method, the `uncaughtExceptionHandler` can be overriden with `setUncaughtExceptionHandler`. This makes the extra information opt-in without fixing it the instance, which can be valuable if your program wants to display uncaught exceptions to users in a user-facing way (ie without backtraces). This is what was originally agreed for CLC#231 or CLC#261 with regard to the type of the exception information. The call stack also becoming part of the default handler rather than the Exception instance is an ammendment to CLC#164. Discussion of the ammendment is part of CLC#285.
Showing
- libraries/base/tests/IO/T21336/T21336a.stderr 0 additions, 12 deletionslibraries/base/tests/IO/T21336/T21336a.stderr
- libraries/base/tests/IO/T21336/T21336b.stderr 0 additions, 14 deletionslibraries/base/tests/IO/T21336/T21336b.stderr
- libraries/base/tests/T24807.stderr 2 additions, 2 deletionslibraries/base/tests/T24807.stderr
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs 1 addition, 1 deletionlibraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs
- libraries/ghc-internal/src/GHC/Internal/Exception.hs 1 addition, 0 deletionslibraries/ghc-internal/src/GHC/Internal/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs 30 additions, 16 deletionslibraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
Loading
Please register or sign in to comment