1
0
Fork 0
mirror of synced 2024-09-28 15:21:28 +12:00

All docs returns no docs if 404.

This commit is contained in:
mike12345567 2024-09-24 15:47:07 +01:00
parent 6d8921978b
commit ad60f8a811

View file

@ -336,7 +336,21 @@ export class DatabaseImpl implements Database {
params: DatabaseQueryOpts
): Promise<AllDocsResponse<T>> {
return this.performCall(db => {
return () => db.list(params)
return async () => {
try {
return (await db.list(params)) as AllDocsResponse<T>
} catch (err: any) {
if (err.status === 404) {
return {
offset: 0,
total_rows: 0,
rows: [],
}
} else {
throw err
}
}
}
})
}