Proper error message when metadata are missing in the mbtiles (close #147)
This commit is contained in:
parent
8ea665297f
commit
366380395e
1 changed files with 6 additions and 0 deletions
|
@ -70,6 +70,12 @@ var startWithMBTiles = function(mbtilesFile) {
|
||||||
}
|
}
|
||||||
var instance = new mbtiles(mbtilesFile, function(err) {
|
var instance = new mbtiles(mbtilesFile, function(err) {
|
||||||
instance.getInfo(function(err, info) {
|
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 bounds = info.bounds;
|
||||||
|
|
||||||
var styleDir = path.resolve(__dirname, "../node_modules/tileserver-gl-styles/");
|
var styleDir = path.resolve(__dirname, "../node_modules/tileserver-gl-styles/");
|
||||||
|
|
Loading…
Reference in a new issue