@@ -12,7 +12,6 @@ import (
1212
1313 kivik "github.com/go-kivik/kivik/v3"
1414 "github.com/go-kivik/kivik/v3/driver"
15- "github.com/go-kivik/kivik/v3/errors"
1615 "github.com/go-kivik/pouchdb/v3/bindings"
1716)
1817
@@ -79,7 +78,7 @@ func (d *db) Put(ctx context.Context, docID string, doc interface{}, options map
7978 jsDoc := js .Global .Get ("JSON" ).Call ("parse" , string (jsonDoc ))
8079 if id := jsDoc .Get ("_id" ); id != js .Undefined {
8180 if id .String () != docID {
82- return "" , errors . Status ( http .StatusBadRequest , "id argument must match _id field in document" )
81+ return "" , & kivik. Error { HTTPStatus : http .StatusBadRequest , Message : "id argument must match _id field in document" }
8382 }
8483 }
8584 jsDoc .Set ("_id" , docID )
@@ -102,7 +101,7 @@ func (d *db) Stats(ctx context.Context) (*driver.DBStats, error) {
102101
103102func (d * db ) Compact (_ context.Context ) error {
104103 if atomic .LoadUint32 (& d .compacting ) == 1 {
105- return & kivik.Error {HTTPStatus : http .StatusTooManyRequests , Err : errors . New ( "kivik: compaction already running" ) }
104+ return & kivik.Error {HTTPStatus : http .StatusTooManyRequests , Message : "kivik: compaction already running" }
106105 }
107106 atomic .StoreUint32 (& d .compacting , 1 )
108107 defer atomic .StoreUint32 (& d .compacting , 0 )
@@ -116,14 +115,14 @@ func (d *db) CompactView(_ context.Context, _ string) error {
116115
117116func (d * db ) ViewCleanup (_ context.Context ) error {
118117 if atomic .LoadUint32 (& d .viewCleanup ) == 1 {
119- return & kivik.Error {HTTPStatus : http .StatusTooManyRequests , Err : errors . New ( "kivik: view cleanup already running" ) }
118+ return & kivik.Error {HTTPStatus : http .StatusTooManyRequests , Message : "kivik: view cleanup already running" }
120119 }
121120 atomic .StoreUint32 (& d .viewCleanup , 1 )
122121 defer atomic .StoreUint32 (& d .viewCleanup , 0 )
123122 return d .db .ViewCleanup ()
124123}
125124
126- var securityNotImplemented = errors . Status ( http .StatusNotImplemented , "kivik: security interface not supported by PouchDB" )
125+ var securityNotImplemented = & kivik. Error { HTTPStatus : http .StatusNotImplemented , Message : "kivik: security interface not supported by PouchDB" }
127126
128127func (d * db ) Security (ctx context.Context ) (* driver.Security , error ) {
129128 return nil , securityNotImplemented
0 commit comments