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

internal/database/drivers/mongodb.Database.GetEvents shouldn't ignore MongoDB errors #40

Open
magnusbaeck opened this issue Nov 2, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@magnusbaeck
Copy link
Member

Description

For some reason, internal/database/drivers/mongodb.Database.GetEvents just ignores any errors returned from a Find call on a collection or All called on a cursor. In the latter case we log the error (at the info level) but then just happily continue to the next collection. This could result in a query happily but incorrectly returning zero results.

Motivation

Errors need to propagate to clients to allow them to retry later or at least be aware that something happened. In this case we're not even logging the error returned from Find so we can end up in some very hard to debug situations.

Exemplification

N/A

Benefits

No risk of returning empty or incomplete results when a query error occurs.

Possible Drawbacks

None.

@magnusbaeck magnusbaeck added the bug Something isn't working label Nov 2, 2022
@magnusbaeck magnusbaeck added this to the v1.0.0 milestone Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant