Catch incorrect header exceptions

This commit is contained in:
Rani Pinchuk 2017-11-03 16:53:45 +01:00
parent 27eb7f0ed8
commit a0eb5800fd

View file

@ -188,7 +188,12 @@ module.exports = function(options, repo, params, id, dataResolver) {
} }
if (format == 'pbf') { if (format == 'pbf') {
try {
response.data = zlib.unzipSync(data); response.data = zlib.unzipSync(data);
}
catch (err) {
console.log("Skipping incorrect header for tile mbtiles://openmaptiles/%z/%x/%y.pbf", z, x, y);
}
if (options.dataDecoratorFunc) { if (options.dataDecoratorFunc) {
response.data = options.dataDecoratorFunc( response.data = options.dataDecoratorFunc(
sourceId, 'data', response.data, z, x, y); sourceId, 'data', response.data, z, x, y);