Merge branch 'master' of github.com:mapbox/node-mbtiles

This commit is contained in:
Tom MacWright
2011-06-29 13:58:18 -04:00
3 changed files with 6 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules
test/fixtures/non_existent.mbtiles

View File

@@ -240,8 +240,8 @@ MBTiles.prototype.grid = function(x, y, z, callback) {
);
},
function(err, row, rows) {
if ((!row || !row.grid) || (err && err.errno == 1)) return callback('Grid does not exist');
if (err) return callback(err);
if (!row || !row.grid) return callback('Grid does not exist');
try {
var grid = zlib.inflate(
@@ -253,10 +253,11 @@ MBTiles.prototype.grid = function(x, y, z, callback) {
memo[r.key_name] = JSON.parse(r.key_json);
return memo;
}, {});
callback(null, _(JSON.parse(grid)).extend({ data: data }));
} catch (err) {
callback('Grid is invalid');
return callback('Grid is invalid');
}
callback(null, _(JSON.parse(grid)).extend({ data: data }));
}
);
};

Binary file not shown.