Skip to content
Snippets Groups Projects
Commit 6a8fa5b4 authored by Ben Gamari's avatar Ben Gamari
Browse files

hi

parent dd1e98cc
No related merge requests found
Pipeline #58074 failed
...@@ -55,7 +55,7 @@ exceptionContext (SomeException _) = ?exc_context ...@@ -55,7 +55,7 @@ exceptionContext (SomeException _) = ?exc_context
-- | Add more 'ExceptionContext' to a 'SomeException'. -- | Add more 'ExceptionContext' to a 'SomeException'.
addExceptionContext :: ExceptionContext -> SomeException -> SomeException addExceptionContext :: ExceptionContext -> SomeException -> SomeException
addExceptionContext ctxt' se@(SomeException e) = addExceptionContext ctxt' se@(SomeException e) =
let ?ctxt = exceptionContext se `mergeExceptionContexts` ctxt' let ?exc_context = exceptionContext se `mergeExceptionContexts` ctxt'
in SomeException e in SomeException e
-- | @since 3.0 -- | @since 3.0
...@@ -169,9 +169,7 @@ class (Typeable e, Show e) => Exception e where ...@@ -169,9 +169,7 @@ class (Typeable e, Show e) => Exception e where
-- | @since 3.0 -- | @since 3.0
instance Exception SomeException where instance Exception SomeException where
toException se = se toException se = se
toExceptionWithContext se@(SomeException e) ctxt = toExceptionWithContext se ctxt = addExceptionContext ctxt se
SomeException e
where ?exc_context = ctxt <> exceptionContext se
fromException = Just fromException = Just
displayException (SomeException e) = displayException (SomeException e) =
displayException e ++ "\n" ++ displayContext ?exc_context displayException e ++ "\n" ++ displayContext ?exc_context
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment