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

Add support for custom error messages #10

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

dmcgowan
Copy link
Member

Add a function to each defined error to set a custom message. This can be helpful when either recreating a error that has been wrapped or wrapped another error. There are also cases where users just don't want to use the default error message.

Due to the Is and As interfaces used by stdlib errors, the new error type is mostly invisible and does not need to be "unwrapped".

errors.go Outdated Show resolved Hide resolved
errors_test.go Outdated Show resolved Hide resolved
errors_test.go Outdated Show resolved Hide resolved
Add a function to each defined error to set a custom message.

Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan
Copy link
Member Author

dmcgowan commented Jul 2, 2024

Updated

@AkihiroSuda AkihiroSuda merged commit 124d0dc into containerd:main Jul 3, 2024
7 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.

3 participants