mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #3602 from overleaf/ta-entity-oerror
Use OError for Entity Not Found Errors GitOrigin-RevId: 847c631236eeae0d328fe3999125208f1304465e
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import OError from '@overleaf/o-error'
|
||||
|
||||
export function findInTreeOrThrow(tree, id) {
|
||||
const found = findInTree(tree, id)
|
||||
if (found) return found
|
||||
throw new Error(`Entity not found with id=${id}`)
|
||||
throw new OError('Entity not found in tree', { entityId: id })
|
||||
}
|
||||
|
||||
export function findAllInTreeOrThrow(tree, ids) {
|
||||
|
||||
Reference in New Issue
Block a user