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

Improve batch error handling #72

Merged
merged 6 commits into from
Dec 3, 2024

Conversation

philhassey
Copy link
Collaborator

This PR changes two things:

  • Makes the error handling for context errors more consistent, it will return an error if you cancel in the last batch request.
  • Adds an error to the batch callback signature. Any error will cause the batch processing to cease and the error to be returned.

Addresses IDX-469

Signed-off-by: philhassey <[email protected]>
Addresses IDX-469

Signed-off-by: philhassey <[email protected]>
@philhassey philhassey self-assigned this Dec 3, 2024
)
testutil.ErrorIs(t, err, errWant)
testutil.Equals(t, total, 2)
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add one more test case here that both returns an error and does a context cancel, and verifies that the returned error is both? As I think no tests here are currently exercising the behaviour that the callback error is joined with the context error.

Copy link
Collaborator

@kjamieson-sdm kjamieson-sdm left a comment

Choose a reason for hiding this comment

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

Looks good, with perhaps the addition of the one more test case suggested.

@philhassey philhassey merged commit 2401ad8 into cedar-policy:main Dec 3, 2024
3 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.

2 participants