-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Currently we store only the last position of source code in error:
data ErrorWithSource err = ErrorWithSource
{ errorWithSourceCallStack :: !SourcePosition
, errorWithSourceType :: !err
} deriving stock (Show, Eq, Functor)This approach has problems that if we have helpers to throw errors, we won't see useful errors messages, unless we wrap those helpers explicitly in withFrozenCallStack. It's quite easy to forget to wrap. Morever, last position might not always be helpful. So I propose to change the data type to the following:
data ErrorWithSource err = ErrorWithSource
{ errorWithSourceCallStack :: !CallStack
, errorWithSourceType :: !err
} deriving stock (Show, Eq, Functor)And change formatting function:
toSourcePosition :: CallStack -> [SourcePosition]And ideally it would be nice to pretty-print this list... What are your ideas? Single source postion is formatted like this:
CakeSlayer.Error.foo#42
How would you format multiple errors?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested