diff --git a/src/internal/connector/graph/errors.go b/src/internal/connector/graph/errors.go index 1b0d86b85..86cec64bd 100644 --- a/src/internal/connector/graph/errors.go +++ b/src/internal/connector/graph/errors.go @@ -1,7 +1,9 @@ package graph import ( + "context" "net/url" + "os" "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" "github.com/pkg/errors" @@ -126,6 +128,10 @@ func hasErrorCode(err error, codes ...string) bool { // timeouts as other errors are handled within a middleware in the // client. func isTimeoutErr(err error) bool { + if errors.Is(err, context.DeadlineExceeded) || os.IsTimeout(err) { + return true + } + switch err := err.(type) { case *url.Error: return err.Timeout()