ion-rust icon indicating copy to clipboard operation
ion-rust copied to clipboard

Refactor IonError in order to contain shared data like position, depth, etc.

Open nirosys opened this issue 2 years ago • 0 comments

With the changes in #458, position information was added to Incomplete errors, which would lead to each variant having to include position data in order to provide it to the user. This task is to make it possible to include higher-level error properties that exist for all errors, and reduce the variant-specific handling that would be needed now.

In order to support more general diagnostic information for errors such as line number, byte offset, depth, etc., an approach like std::io::Error/ErrorKind can be used to house the common data (in the Error), while still tracking specific error types and error-specific information (in the ErrorKind).

For a short discussion see the conversation from #458, here.

nirosys avatar Jan 19 '23 22:01 nirosys