mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-26 18:29:51 +00:00
throw error after catch (#4442)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
7ced4001f3
commit
7879dffc3c
@ -601,13 +601,14 @@ abstract class MongoAdapterBase implements DbAdapter {
|
|||||||
let res: T[] = []
|
let res: T[] = []
|
||||||
try {
|
try {
|
||||||
res = await cursor.toArray()
|
res = await cursor.toArray()
|
||||||
|
if (options?.total === true && options?.limit === undefined) {
|
||||||
|
total = res.length
|
||||||
|
}
|
||||||
|
return toFindResult(this.stripHash(res), total)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error during executing cursor in findAll', _class, cutObjectArray(query), options, 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[] {
|
stripHash<T extends Doc>(docs: T[]): T[] {
|
||||||
|
Loading…
Reference in New Issue
Block a user