Exception rethrowing
Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> (cherry picked from commit ac004028)
Showing
- libraries/base/src/Control/Exception.hs 6 additions, 1 deletionlibraries/base/src/Control/Exception.hs
- libraries/base/tests/IO/T21336/T21336b.stderr 5 additions, 6 deletionslibraries/base/tests/IO/T21336/T21336b.stderr
- libraries/base/tests/IO/T4808.stderr 4 additions, 6 deletionslibraries/base/tests/IO/T4808.stderr
- libraries/base/tests/IO/mkdirExists.stderr 5 additions, 6 deletionslibraries/base/tests/IO/mkdirExists.stderr
- libraries/base/tests/IO/openFile002.stderr 5 additions, 6 deletionslibraries/base/tests/IO/openFile002.stderr
- libraries/base/tests/IO/openFile002.stderr-mingw32 1 addition, 0 deletionslibraries/base/tests/IO/openFile002.stderr-mingw32
- libraries/base/tests/IO/withBinaryFile001.stderr 5 additions, 6 deletionslibraries/base/tests/IO/withBinaryFile001.stderr
- libraries/base/tests/IO/withBinaryFile002.stderr 0 additions, 9 deletionslibraries/base/tests/IO/withBinaryFile002.stderr
- libraries/base/tests/IO/withFile001.stderr 5 additions, 6 deletionslibraries/base/tests/IO/withFile001.stderr
- libraries/base/tests/IO/withFile002.stderr 0 additions, 9 deletionslibraries/base/tests/IO/withFile002.stderr
- libraries/base/tests/IO/withFileBlocking001.stderr 5 additions, 6 deletionslibraries/base/tests/IO/withFileBlocking001.stderr
- libraries/base/tests/IO/withFileBlocking002.stderr 0 additions, 9 deletionslibraries/base/tests/IO/withFileBlocking002.stderr
- libraries/base/tests/T15349.stderr 9 additions, 5 deletionslibraries/base/tests/T15349.stderr
- libraries/ghc-internal/src/GHC/Internal/Control/Exception.hs 11 additions, 0 deletionslibraries/ghc-internal/src/GHC/Internal/Control/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs 25 additions, 13 deletions...s/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs 25 additions, 1 deletionlibraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- libraries/ghc-internal/src/GHC/Internal/IO.hs 35 additions, 6 deletionslibraries/ghc-internal/src/GHC/Internal/IO.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs 1 addition, 1 deletionlibraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/FD.hs 28 additions, 19 deletionslibraries/ghc-internal/src/GHC/Internal/IO/Handle/FD.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs 4 additions, 3 deletions...ries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
Loading
Please register or sign in to comment