Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Exception.Annotation.Utils
Description
Provides utilities for working with GHC's native Exception annotations.
Since: 0.1
Synopsis
- data ExceptionProxy = Exception e => MkExceptionProxy
- matchesException :: Exception e => [ExceptionProxy] -> e -> Bool
- setIgnoreKnownCallStackHandler :: [ExceptionProxy] -> IO ()
- ignoreKnownCallStackHandler :: [ExceptionProxy] -> (SomeException -> IO ()) -> SomeException -> IO ()
- ignoreCallStackHandler :: SomeException -> IO ()
Exception matching
data ExceptionProxy Source #
Proxy for exception types. Used for matching multiple exception types.
Since: 0.1
Constructors
Exception e => MkExceptionProxy |
matchesException :: Exception e => [ExceptionProxy] -> e -> Bool Source #
Returns true iff e matches some ExceptionProxy.
Since: 0.1
Ignoring known callstacks
setIgnoreKnownCallStackHandler :: [ExceptionProxy] -> IO () Source #
Augments the current global exception handler with the logic to ignore
callstacks on known exceptions, per the parameter proxy list. In other
words, merely calls displayException
on known exceptions. Note that
on older GHCs (< 9.12), this may still print a callstack as the callstack
is part of the SomeException
type, prior to the exceptions redesign.
Since: 0.1
ignoreKnownCallStackHandler Source #
Arguments
:: [ExceptionProxy] | Exception proxies to match. |
-> (SomeException -> IO ()) | Previous handler, to use when we do not have a match. |
-> SomeException | Augmented handler. |
-> IO () |
Augments the parameter handler with logic to avoid callstacks when the exception matches one of the proxies.
Since: 0.1
ignoreCallStackHandler :: SomeException -> IO () Source #
Exception handler that merely calls displayException
, thereby avoiding
callstacks for GHC >= 9.12.
Since: 0.1