[Git][ghc/ghc][wip/romes/exception-propagation-backport] 4 commits: Fix toException method for ExceptionWithContext

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Sep 30 09:54:34 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/exception-propagation-backport at Glasgow Haskell Compiler / GHC


Commits:
217efe2a by Matthew Pickering at 2024-09-30T10:54:25+01:00
Fix toException method for ExceptionWithContext

Fixes #25235

- - - - -
8416eed0 by Matthew Pickering at 2024-09-30T10:54:25+01:00
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>

- - - - -
0e5cff66 by Rodrigo Mesquita at 2024-09-30T10:54:25+01:00
Add test for #25300

- - - - -
e44e448e by Rodrigo Mesquita at 2024-09-30T10:54:25+01:00
Backport !13302 docs to users guide

- - - - -


30 changed files:

- docs/users_guide/9.12.1-notes.rst
- libraries/base/changelog.md
- libraries/base/src/Control/Exception.hs
- libraries/base/tests/IO/T21336/T21336b.stderr
- libraries/base/tests/IO/T4808.stderr
- libraries/base/tests/IO/mkdirExists.stderr
- libraries/base/tests/IO/openFile002.stderr
- libraries/base/tests/IO/withBinaryFile001.stderr
- libraries/base/tests/IO/withBinaryFile002.stderr
- libraries/base/tests/IO/withFile001.stderr
- libraries/base/tests/IO/withFile002.stderr
- libraries/base/tests/IO/withFileBlocking001.stderr
- libraries/base/tests/IO/withFileBlocking002.stderr
- libraries/base/tests/T15349.stderr
- libraries/ghc-internal/src/GHC/Internal/Control/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- libraries/ghc-internal/src/GHC/Internal/IO.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/FD.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Text.hs
- libraries/ghc-internal/src/GHC/Internal/System/IO/Error.hs
- testsuite/tests/codeGen/should_run/cgrun016.stderr
- testsuite/tests/codeGen/should_run/cgrun025.stderr
- testsuite/tests/concurrent/should_run/T3279.hs
- + testsuite/tests/exceptions/T25300.hs
- + testsuite/tests/exceptions/T25300a.stdout
- testsuite/tests/exceptions/all.T
- testsuite/tests/ffi/should_run/T7170.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9064b6b67c74622a363b60ff1bf0e526e08865a4...e44e448ea8745a04724420edfa6ab4d24252a53f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9064b6b67c74622a363b60ff1bf0e526e08865a4...e44e448ea8745a04724420edfa6ab4d24252a53f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240930/4466e3ab/attachment.html>


More information about the ghc-commits mailing list