Merge pull request #179 from tschaub/err

Log errors to stderr and return
This commit is contained in:
Petr Sloup 2017-06-20 17:29:39 +02:00 committed by GitHub
commit 95470143b6

View file

@ -223,7 +223,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
}
mbtilesFile = dataResolver(mbtilesFile);
if (!mbtilesFile) {
console.log('ERROR: data "' + mbtilesFile + '" not found!');
console.error('ERROR: data "' + mbtilesFile + '" not found!');
process.exit(1);
}
}
@ -238,6 +238,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
map.sources[name].getInfo(function(err, info) {
if (err) {
console.error(err);
return;
}
if (!dataProjWGStoInternalWGS && info.proj4) {
@ -348,7 +349,10 @@ module.exports = function(options, repo, params, id, dataResolver) {
}
renderer.render(params, function(err, data) {
pool.release(renderer);
if (err) console.log(err);
if (err) {
console.error(err);
return;
}
var image = sharp(data, {
raw: {