@@ -11,6 +11,7 @@ package db
11
11
import (
12
12
"bytes"
13
13
"context"
14
+ "errors"
14
15
"fmt"
15
16
"math"
16
17
"net/http"
@@ -21,7 +22,7 @@ import (
21
22
"github.com/couchbase/sync_gateway/auth"
22
23
"github.com/couchbase/sync_gateway/base"
23
24
"github.com/couchbase/sync_gateway/channels"
24
- "github.com/pkg/errors"
25
+ pkgerrors "github.com/pkg/errors"
25
26
)
26
27
27
28
const (
@@ -699,7 +700,7 @@ func (db *DatabaseCollectionWithUser) get1xRevFromDoc(ctx context.Context, doc *
699
700
// Update: this applies to non-deletions too, since the client may have lost access to
700
701
// the channel and gotten a "removed" entry in the _changes feed. It then needs to
701
702
// incorporate that tombstone and for that it needs to see the _revisions property.
702
- if revid == "" || doc .History [revid ] == nil || err == ErrMissing {
703
+ if revid == "" || doc .History [revid ] == nil || errors . Is ( err , ErrMissing ) {
703
704
return nil , false , err
704
705
}
705
706
if doc .History [revid ].Deleted {
@@ -1722,7 +1723,7 @@ func (db *DatabaseCollectionWithUser) addAttachments(ctx context.Context, newAtt
1722
1723
if errors .Is (err , ErrAttachmentTooLarge ) || err .Error () == "document value was too large" {
1723
1724
err = base .HTTPErrorf (http .StatusRequestEntityTooLarge , "Attachment too large" )
1724
1725
} else {
1725
- err = errors .Wrap (err , "Error adding attachment" )
1726
+ err = pkgerrors .Wrap (err , "Error adding attachment" )
1726
1727
}
1727
1728
}
1728
1729
return err
0 commit comments