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

docs: add section on error values to resource author's guide #347

Merged
merged 2 commits into from
Oct 5, 2016

Conversation

BrianHicks
Copy link
Contributor

Ping @ryane

### Dealing with Errors

The default `Status` implementation has a `SetError(error)` method. When called,
it sets an appropriate error level and an internal error state that will be
Copy link
Contributor

@ryane ryane Oct 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you also return the error if you call SetError?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I've added a section to clarify in ebd589c

presented to the user. You can also use the common Go patterm of returning `nil,
err` in your `Check` and `Apply` statements. Converge will call `SetError(err)`
automatically in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, until #345 is merged, your error can be lost (regardless of whether you SetError or just return it) if the final plan phase HasChanges

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll consider that a blocker for this.

@BrianHicks BrianHicks force-pushed the feature/status-error-docs branch from edb589c to 2e2830f Compare October 5, 2016 16:24
@BrianHicks BrianHicks merged commit d09e872 into master Oct 5, 2016
@BrianHicks BrianHicks deleted the feature/status-error-docs branch October 5, 2016 16:32
BrianHicks added a commit that referenced this pull request Dec 22, 2016
docs: add section on error values to resource author's guide
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.

2 participants