Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion x/mongo/driver/drivertest/opmsg_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ var (
Max: driverutil.MaxWireVersion,
},
}

// ErrNoResponsesRemaining is the error returned when the mocked connection is asked for a response and does not have
// any responses buffered.
ErrNoResponsesRemaining = errors.New("no responses remaining")
)

// connection implements the driver.Connection interface and responds to wire messages with pre-configured responses.
Expand All @@ -71,7 +75,7 @@ func (c *connection) SetOIDCTokenGenID(uint64) {
func (c *connection) Read(_ context.Context) ([]byte, error) {
var dst []byte
if len(c.responses) == 0 {
return dst, errors.New("no responses remaining")
return dst, ErrNoResponsesRemaining
}
nextRes := c.responses[0]
c.responses = c.responses[1:]
Expand Down
Loading