@@ -11,6 +11,7 @@ package db
1111import (
1212 "bytes"
1313 "context"
14+ "errors"
1415 "fmt"
1516 "math"
1617 "net/http"
@@ -21,7 +22,7 @@ import (
2122 "github.com/couchbase/sync_gateway/auth"
2223 "github.com/couchbase/sync_gateway/base"
2324 "github.com/couchbase/sync_gateway/channels"
24- "github.com/pkg/errors"
25+ pkgerrors "github.com/pkg/errors"
2526)
2627
2728const (
@@ -702,7 +703,7 @@ func (db *DatabaseCollectionWithUser) get1xRevFromDoc(ctx context.Context, doc *
702703 // Update: this applies to non-deletions too, since the client may have lost access to
703704 // the channel and gotten a "removed" entry in the _changes feed. It then needs to
704705 // incorporate that tombstone and for that it needs to see the _revisions property.
705- if revid == "" || doc .History [revid ] == nil || err == ErrMissing {
706+ if revid == "" || doc .History [revid ] == nil || errors . Is ( err , ErrMissing ) {
706707 return nil , false , err
707708 }
708709 if doc .History [revid ].Deleted {
@@ -1582,7 +1583,7 @@ func (db *DatabaseCollectionWithUser) addAttachments(ctx context.Context, newAtt
15821583 if errors .Is (err , ErrAttachmentTooLarge ) || err .Error () == "document value was too large" {
15831584 err = base .HTTPErrorf (http .StatusRequestEntityTooLarge , "Attachment too large" )
15841585 } else {
1585- err = errors .Wrap (err , "Error adding attachment" )
1586+ err = pkgerrors .Wrap (err , "Error adding attachment" )
15861587 }
15871588 }
15881589 return err
0 commit comments