One small change to keep 404 functionality on destroy DB.
This commit is contained in:
parent
b6bcf6719f
commit
f036776a90
|
@ -314,9 +314,16 @@ export class DatabaseImpl implements Database {
|
||||||
}
|
}
|
||||||
|
|
||||||
async destroy() {
|
async destroy() {
|
||||||
return this.performCall(async () => {
|
try {
|
||||||
return () => this.nano().db.destroy(this.name)
|
return await this.nano().db.destroy(this.name)
|
||||||
})
|
} catch (err: any) {
|
||||||
|
// didn't exist, don't worry
|
||||||
|
if (err.statusCode === 404) {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
throw new CouchDBError(err.message, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async compact() {
|
async compact() {
|
||||||
|
|
Loading…
Reference in New Issue