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

Suggestion: Clarify returned error documentation #51

Closed
juanigsrz opened this issue Feb 12, 2021 · 1 comment
Closed

Suggestion: Clarify returned error documentation #51

juanigsrz opened this issue Feb 12, 2021 · 1 comment

Comments

@juanigsrz
Copy link

In the v4 version you can return errors such as ErrDoNotRestart and ErrTerminateTree to determine further actions on the status of the service. It might be something a little bit stupid, but I did not know about 1.13 error features and so I spent a little bit figuring out the best way to return these errors without writing too much workaround code.

In the end, suture/v4 uses errors.Is() to check if an error matches a target error, such as ErrDoNotRestart. So it's not exactly needed to return, for example, ErrDoNotRestart, because as long as you wrap it inside your error the supervisor will recognize it as such.

thejerf added a commit that referenced this issue May 3, 2021
…e errors as well.

This uses the build context tags to make this version-sensitive. Online
services will probably only show the latest version but people consulting
their local godoc servers will see the correct documentation. I think.
@thejerf
Copy link
Owner

thejerf commented May 3, 2021

The fixes in the commit should help. It was, technically, documented elsewhere, but it doesn't hurt to try to move it closer to the errors themselves.

@thejerf thejerf closed this as completed May 3, 2021
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

No branches or pull requests

2 participants