annotated-exception icon indicating copy to clipboard operation
annotated-exception copied to clipboard

Helper to auto-promote `SomeException -> AnnotatedException SomeException`

Open parsonsmatt opened this issue 1 year ago • 0 comments

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.

parsonsmatt avatar Jan 24 '24 15:01 parsonsmatt