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

Allow errors in signal interceptors #564

Merged
merged 4 commits into from
Oct 8, 2021
Merged

Conversation

vitarb
Copy link
Contributor

@vitarb vitarb commented Sep 29, 2021

What was changed

Allowed errors in signal interceptors.

Why?

Previously there was no way to return an error from the signal interceptor, meaning that even if there is a problem signal would be processed anyways and it was impossible to interrupt the flow. This can be a problem in case if interceptor is doing some non-optional operations that have a chance to fail (e.g. network interactions).

@@ -2249,7 +2249,7 @@ func (env *testWorkflowEnvironmentImpl) signalWorkflow(name string, input interf
panic(err)
}
env.postCallback(func() {
env.signalHandler(name, data)
_ = env.signalHandler(name, data)
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious, this seems like a JetBrains-ism, is it? I don't think any traditional go tools have any problem with ignoring these returns.

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 have errorcheck linter, which complains if you ignore an error.

@vitarb vitarb merged commit 2c0af69 into temporalio:master Oct 8, 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

Successfully merging this pull request may close these issues.

3 participants