throw error after catch (#4442)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2024-01-25 14:09:28 +05:00 committed by GitHub
parent 7ced4001f3
commit 7879dffc3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -601,13 +601,14 @@ abstract class MongoAdapterBase implements DbAdapter {
let res: T[] = []
try {
res = await cursor.toArray()
if (options?.total === true && options?.limit === undefined) {
total = res.length
}
return toFindResult(this.stripHash(res), total)
} catch (e) {
console.error('error during executing cursor in findAll', _class, cutObjectArray(query), options, e)
throw e
}
if (options?.total === true && options?.limit === undefined) {
total = res.length
}
return toFindResult(this.stripHash(res), total)
}
stripHash<T extends Doc>(docs: T[]): T[] {