Merge pull request #232 from rani-pinchuk/fix-zlib-incorrect-header-check
Catch incorrect header exceptions
This commit is contained in:
commit
83e20b7a4e
1 changed files with 6 additions and 1 deletions
|
@ -188,7 +188,12 @@ module.exports = function(options, repo, params, id, dataResolver) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format == 'pbf') {
|
if (format == 'pbf') {
|
||||||
response.data = zlib.unzipSync(data);
|
try {
|
||||||
|
response.data = zlib.unzipSync(data);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.log("Skipping incorrect header for tile mbtiles://%s/%s/%s/%s.pbf", id, 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);
|
||||||
|
|
Loading…
Reference in a new issue