forked from MapComplete/MapComplete
Fix: add better error message if "requiredLayers" didn't set an ID
This commit is contained in:
parent
3c7441d93b
commit
01d924374e
1 changed files with 6 additions and 2 deletions
|
|
@ -15,8 +15,12 @@ export default class DependencyCalculator {
|
||||||
}
|
}
|
||||||
const deps: { id: string; minZoom?: number; neededBy: string }[] = []
|
const deps: { id: string; minZoom?: number; neededBy: string }[] = []
|
||||||
|
|
||||||
if (tr.requiredLayers) {
|
for (const req of tr.requiredLayers ?? []) {
|
||||||
deps.push(...tr.requiredLayers.map((req) => ({ ...req, neededBy: tr.id })))
|
const dependency = { ...req, neededBy: tr.id }
|
||||||
|
if (!dependency.id) {
|
||||||
|
throw `The tagRendering ${tr.id} specifies a \`requiredBy\`, but this \`requiredBy\` does _not_ have an \`id\`-field`
|
||||||
|
}
|
||||||
|
deps.push(dependency)
|
||||||
}
|
}
|
||||||
|
|
||||||
// All translated snippets
|
// All translated snippets
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue