Skip to content

Commit

Permalink
GODRIVER-2929 Make driver.ErrDeadlineWouldBeExceeded wrap context.Dea…
Browse files Browse the repository at this point in the history
…dlineExceeded (#1355)
  • Loading branch information
matthewdale committed Aug 17, 2023
1 parent 4bd1c27 commit e2c90c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions x/mongo/driver/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package driver

import (
"bytes"
"context"
"errors"
"fmt"
"strings"
Expand Down Expand Up @@ -51,9 +52,12 @@ var (
// ErrUnsupportedStorageEngine is returned when a retryable write is attempted against a server
// that uses a storage engine that does not support retryable writes
ErrUnsupportedStorageEngine = errors.New("this MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string")
// ErrDeadlineWouldBeExceeded is returned when a Timeout set on an operation would be exceeded
// if the operation were sent to the server.
ErrDeadlineWouldBeExceeded = errors.New("operation not sent to server, as Timeout would be exceeded")
// ErrDeadlineWouldBeExceeded is returned when a Timeout set on an operation
// would be exceeded if the operation were sent to the server. It wraps
// context.DeadlineExceeded.
ErrDeadlineWouldBeExceeded = fmt.Errorf(
"operation not sent to server, as Timeout would be exceeded: %w",
context.DeadlineExceeded)
// ErrNegativeMaxTime is returned when MaxTime on an operation is a negative value.
ErrNegativeMaxTime = errors.New("a negative value was provided for MaxTime on an operation")
)
Expand Down

0 comments on commit e2c90c9

Please sign in to comment.