Handle missing table errors gracefully in getGeocoderData
This commit is contained in:
@@ -600,6 +600,7 @@ MBTiles.prototype.putInfo = function(data, callback) {
|
||||
// Implements carmen#getGeocoderData method.
|
||||
MBTiles.prototype.getGeocoderData = function(type, shard, callback) {
|
||||
return this._db.get('SELECT data FROM geocoder_data WHERE type = ? AND shard = ?', type, shard, function(err, row) {
|
||||
if (err && err.code === 'SQLITE_ERROR' && err.errno === 1) return callback();
|
||||
if (err) return callback(err);
|
||||
if (!row) return callback();
|
||||
zlib.inflate(row.data, callback);
|
||||
|
||||
Reference in New Issue
Block a user