Proper error message when metadata are missing in the mbtiles (close #147)

This commit is contained in:
Petr Sloup 2017-04-11 19:10:40 +02:00
parent 8ea665297f
commit 366380395e

View file

@ -70,6 +70,12 @@ var startWithMBTiles = function(mbtilesFile) {
}
var instance = new mbtiles(mbtilesFile, function(err) {
instance.getInfo(function(err, info) {
if (err || !info) {
console.log('ERROR: Metadata missing in the MBTiles.');
console.log(' Make sure ' + path.basename(mbtilesFile) +
' is valid MBTiles.');
process.exit(1);
}
var bounds = info.bounds;
var styleDir = path.resolve(__dirname, "../node_modules/tileserver-gl-styles/");