Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4error code wrapping with some generic reuse #29

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Conversation

gregwebs
Copy link
Owner

@gregwebs gregwebs commented Oct 4, 2024

The goal is to wrap an ErrorCode
while maintaining its type.
This allows for using UserCode as a marke type
that a user message will be returned
and still allows for wrapping the error
with extra information.

In-place modification accomplishes this,
and will be used if available (via ErrorWrapper)
However, requiring this in the ErrorCode interface is too burdensome.
Instead fallback to a wrapper type
that will be different per-interface.
There are different wrapping functions for each interface to maintain the type and not downcast to ErrorCode.

The goal is to wrap an ErrorCode
while maintaining its type.
This allows for using UserCode as a marke type
that a user message will be returned
and still allows for wrapping the error
with extra information.

In-place modification accomplishes this,
and will be used if available (via ErrorWrapper)
However, requiring this in the ErrorCode interface
is too burdensome.
Instead fallback to a wrapper type
that will be different per-interface.
There are different wrapping functions for each interface
to maintain the type and not downcast to ErrorCode.
@gregwebs gregwebs force-pushed the wrap-maintain-type branch from a65d526 to d6f18ff Compare October 4, 2024 02:28
@gregwebs gregwebs merged commit c855939 into master Oct 4, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant