1
0
Fork 0
mirror of synced 2024-09-09 22:16:26 +12:00

One small change to keep 404 functionality on destroy DB.

This commit is contained in:
mike12345567 2024-05-10 11:32:57 +01:00
parent 76449782b5
commit 1aa89c61b6

View file

@ -314,9 +314,16 @@ export class DatabaseImpl implements Database {
}
async destroy() {
return this.performCall(async () => {
return () => this.nano().db.destroy(this.name)
})
try {
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() {