[Git][ghc/ghc][wip/romes/26058] base: Export displayExceptionWithInfo

Rodrigo Mesquita pushed to branch wip/romes/26058 at Glasgow Haskell Compiler / GHC Commits: e55d13db by Rodrigo Mesquita at 2025-06-17T13:54:03+01:00 base: Export displayExceptionWithInfo This function should be exposed from base; follows from CLC#285 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,7 +246,7 @@ 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 ===================================== 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/e55d13db48b6fedca6168af24b86ccdf... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e55d13db48b6fedca6168af24b86ccdf... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)