tileserver-gl-light 5.4.0-pre.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/serve_rendered.js
CHANGED
|
@@ -1202,10 +1202,30 @@ export const serve_rendered = {
|
|
|
1202
1202
|
parsedResponse.data = responseData;
|
|
1203
1203
|
callback(null, parsedResponse);
|
|
1204
1204
|
} catch (error) {
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1205
|
+
if (error.response && error.response.status === 410) {
|
|
1206
|
+
// This is the 410 "Gone" error, treat as sparse
|
|
1207
|
+
if (verbose) {
|
|
1208
|
+
console.log(
|
|
1209
|
+
'fetchTile warning on %s, sparse response due to 410 Gone',
|
|
1210
|
+
req.url,
|
|
1211
|
+
);
|
|
1212
|
+
}
|
|
1213
|
+
callback();
|
|
1214
|
+
} else {
|
|
1215
|
+
// For all other errors (e.g., network errors, 404, 500, etc.) return empty content.
|
|
1216
|
+
console.error(
|
|
1217
|
+
`Error fetching remote URL ${req.url}:`,
|
|
1218
|
+
error.message || error,
|
|
1219
|
+
error.response
|
|
1220
|
+
? `Status: ${error.response.status}`
|
|
1221
|
+
: 'No response received',
|
|
1222
|
+
);
|
|
1223
|
+
|
|
1224
|
+
const parts = url.parse(req.url);
|
|
1225
|
+
const extension = path.extname(parts.pathname).toLowerCase();
|
|
1226
|
+
const format = extensionToFormat[extension] || '';
|
|
1227
|
+
createEmptyResponse(format, '', callback);
|
|
1228
|
+
}
|
|
1209
1229
|
}
|
|
1210
1230
|
} else if (protocol === 'file') {
|
|
1211
1231
|
const name = decodeURI(req.url).substring(protocol.length + 3);
|