Skip to content

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

@magnusbaeck

Description

@magnusbaeck

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions