Small fixes to the 'generateCache' script
This commit is contained in:
parent
5bcb879dfe
commit
23136f7e7a
4 changed files with 11 additions and 14 deletions
|
@ -97,17 +97,16 @@ async function downloadRaw(targetdir: string, r: TileRange, theme: LayoutConfig,
|
|||
try {
|
||||
|
||||
const json = await ScriptUtils.DownloadJSON(url)
|
||||
if (json.elements.length === 0) {
|
||||
console.log("Got an empty response!")
|
||||
if ((<string>json.remark ?? "").startsWith("runtime error")) {
|
||||
console.error("Got a runtime error: ", json.remark)
|
||||
failed++;
|
||||
}
|
||||
if ((<string>json.remark ?? "").startsWith("runtime error")) {
|
||||
console.error("Got a runtime error: ", json.remark)
|
||||
failed++;
|
||||
}else if (json.elements.length === 0) {
|
||||
console.log("Got an empty response! Writing anyway")
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
console.log("Got the response - writing to ", filename)
|
||||
writeFileSync(filename, JSON.stringify(json, null, " "));
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(url)
|
||||
console.log("Could not download - probably hit the rate limit; waiting a bit. (" + err + ")")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue