annotated-exception
annotated-exception copied to clipboard
Helper to auto-promote `SomeException -> AnnotatedException SomeException`
foo :: SomeException -> AnnotatedException SomeException
foo se =
case fromException se of
Just ann -> ann
Nothing -> error "impossible"
This should be a safe utility to provide, since fromException for AnnotatedException will always either provide the true underlying AnnotatedException or promote to AnnotatedException [] original.