From c0ed6d34eca73827ce0327be42d2a0ef74e59868 Mon Sep 17 00:00:00 2001 From: Will White Date: Thu, 23 Jun 2011 13:43:05 -0400 Subject: [PATCH] Return proper "not found" error when utfgrid tables are missing. --- lib/mbtiles.js | 2 +- test/fixtures/plain_1.mbtiles | Bin 561152 -> 561152 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mbtiles.js b/lib/mbtiles.js index 7039fc5..f29ad34 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -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( diff --git a/test/fixtures/plain_1.mbtiles b/test/fixtures/plain_1.mbtiles index 8134d91c4f62e11aee7b7f43c2705d5ed02f6b79..2ca86459d6e12d3d3a52ca2b913f612c5918a89e 100644 GIT binary patch delta 262 zcmZozpwzHHX@az18v_HA3IhW}0ub{8vDic%W1yh!BUx4;kCFK|kYwQ9SkTGL$h!F# zGrNW)qYwiNLo)+IGm{}x2h&~Vl`uH5E@g6^&J-4A2S)kHlFSh-j7J&5Cm&)828uA` zY(A-5&d35Z?7+l(sUSLh@>=~6UZ$rE%#7{~jP8t68E;MIGdRTp6v^Lw$AFUwsEARz z`K8hJmqv_oo`yU?mx=)Oy#Wfh1KFZLEC$5NKrv1rW(HzzAO^Xc3y4|TEovBnmry7y=}eg{${aI!A5-|`Ag0{SMtXdV z6K`csme&dA;|1zuWw^n>aD&mEaq46~gHtTIT