
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: ef03d8b8 by Rodrigo Mesquita at 2025-07-09T09:45:28-04:00 base: Export displayExceptionWithInfo This function should be exposed from base following CLC#285 Approved change in CLC#344 Fixes #26058 - - - - - 6 changed files: - libraries/base/src/Control/Exception.hs - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 Changes: ===================================== libraries/base/src/Control/Exception.hs ===================================== @@ -116,7 +116,9 @@ module Control.Exception bracket_, bracketOnError, finally, - onException + onException, + -- ** Printing + displayExceptionWithInfo ) where ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -246,10 +246,10 @@ instance Exception SomeException where -- * The exception context -- -- By default, 'uncaughtExceptionHandler' uses 'displayExceptionWithInfo' to print uncaught exceptions. --- This default can be overriden with 'setUncaughtExceptionHandler', for +-- This default can be overridden with 'setUncaughtExceptionHandler', for -- instance, to present custom error messages on exceptions to the user. -- --- @since base-4.21 +-- @since base-4.22 displayExceptionWithInfo :: SomeException -> String displayExceptionWithInfo (SomeException e) = case displayExceptionContext ?exceptionContext of ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -285,6 +285,7 @@ module Control.Exception where catchJust :: forall e b a. Exception e => (e -> GHC.Internal.Maybe.Maybe b) -> GHC.Internal.Types.IO a -> (b -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catchNoPropagate :: forall e a. Exception e => GHC.Internal.Types.IO a -> (ExceptionWithContext e -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catches :: forall a. GHC.Internal.Types.IO a -> [Handler a] -> GHC.Internal.Types.IO a + displayExceptionWithInfo :: SomeException -> GHC.Internal.Base.String evaluate :: forall a. a -> GHC.Internal.Types.IO a finally :: forall a b. GHC.Internal.Types.IO a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO a getMaskingState :: GHC.Internal.Types.IO MaskingState ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -285,6 +285,7 @@ module Control.Exception where catchJust :: forall e b a. Exception e => (e -> GHC.Internal.Maybe.Maybe b) -> GHC.Internal.Types.IO a -> (b -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catchNoPropagate :: forall e a. Exception e => GHC.Internal.Types.IO a -> (ExceptionWithContext e -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catches :: forall a. GHC.Internal.Types.IO a -> [Handler a] -> GHC.Internal.Types.IO a + displayExceptionWithInfo :: SomeException -> GHC.Internal.Base.String evaluate :: forall a. a -> GHC.Internal.Types.IO a finally :: forall a b. GHC.Internal.Types.IO a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO a getMaskingState :: GHC.Internal.Types.IO MaskingState ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -285,6 +285,7 @@ module Control.Exception where catchJust :: forall e b a. Exception e => (e -> GHC.Internal.Maybe.Maybe b) -> GHC.Internal.Types.IO a -> (b -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catchNoPropagate :: forall e a. Exception e => GHC.Internal.Types.IO a -> (ExceptionWithContext e -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catches :: forall a. GHC.Internal.Types.IO a -> [Handler a] -> GHC.Internal.Types.IO a + displayExceptionWithInfo :: SomeException -> GHC.Internal.Base.String evaluate :: forall a. a -> GHC.Internal.Types.IO a finally :: forall a b. GHC.Internal.Types.IO a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO a getMaskingState :: GHC.Internal.Types.IO MaskingState ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -285,6 +285,7 @@ module Control.Exception where catchJust :: forall e b a. Exception e => (e -> GHC.Internal.Maybe.Maybe b) -> GHC.Internal.Types.IO a -> (b -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catchNoPropagate :: forall e a. Exception e => GHC.Internal.Types.IO a -> (ExceptionWithContext e -> GHC.Internal.Types.IO a) -> GHC.Internal.Types.IO a catches :: forall a. GHC.Internal.Types.IO a -> [Handler a] -> GHC.Internal.Types.IO a + displayExceptionWithInfo :: SomeException -> GHC.Internal.Base.String evaluate :: forall a. a -> GHC.Internal.Types.IO a finally :: forall a b. GHC.Internal.Types.IO a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO a getMaskingState :: GHC.Internal.Types.IO MaskingState View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef03d8b8851a1cace5f792fe5a91b6b2... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef03d8b8851a1cace5f792fe5a91b6b2... You're receiving this email because of your account on gitlab.haskell.org.