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

GODRIVER-2489 createPipelineOptionsDoc: return err #1036

Merged
merged 2 commits into from Aug 2, 2022
Merged

GODRIVER-2489 createPipelineOptionsDoc: return err #1036

merged 2 commits into from Aug 2, 2022

Conversation

prestonvasquez
Copy link
Collaborator

GODRIVER-2489

Update createPipelineOptionsDoc to return error to shore up non-idomatic error handling in the the change stream operations.

@prestonvasquez prestonvasquez marked this pull request as ready for review July 29, 2022 21:43
Copy link
Collaborator

@qingyang-hu qingyang-hu left a comment

Choose a reason for hiding this comment

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

It's good that we can update non-idomatic error handlings.
Thank you, Preston!

csOptDoc := cs.createPipelineOptionsDoc()
if cs.err != nil {
csOptDoc, err := cs.createPipelineOptionsDoc()
if err != nil {
return cs.Err()
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's confusing to check an error and then return a different error. Update this to return err (instead of cs.Err()) if it's not nil.

if cs.err != nil {

csDocTemp, err := cs.createPipelineOptionsDoc()
if err != nil {
return cs.err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above: It's confusing to check an error and then return a different error. Update this to return err (instead of cs.err) if it's not nil.

Copy link
Collaborator

@matthewdale matthewdale 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 👍

@prestonvasquez prestonvasquez merged commit f957b92 into mongodb:master Aug 2, 2022
@prestonvasquez prestonvasquez deleted the GODRIVER-2489 branch August 2, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants