Reject source info promise on error
This commit is contained in:
parent
f545076986
commit
5ed632c229
1 changed files with 8 additions and 0 deletions
|
@ -37,7 +37,15 @@ module.exports = function(options, repo, params, id, styles) {
|
||||||
var source;
|
var source;
|
||||||
var sourceInfoPromise = new Promise(function(resolve, reject) {
|
var sourceInfoPromise = new Promise(function(resolve, reject) {
|
||||||
source = new mbtiles(mbtilesFile, function(err) {
|
source = new mbtiles(mbtilesFile, function(err) {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
source.getInfo(function(err, info) {
|
source.getInfo(function(err, info) {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
tileJSON['name'] = id;
|
tileJSON['name'] = id;
|
||||||
tileJSON['format'] = 'pbf';
|
tileJSON['format'] = 'pbf';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue