diff options
-rw-r--r-- | lib/app.js | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -352,12 +352,16 @@ App.prototype.getNameSync = function (name) { function sbotGet(sbot, id, cb) { // try sbot.get via ssb-ooo a50da3928500f3ac0fbead0a1b335a3dd5bbc096 first - sbot.get({id: id, raw: true}, function (err, value) { - if (err && err.message === 'Param 0 must by of type number') { - return sbot.get(id, cb) - } - cb(err, value) - }) + try { + sbot.get({id: id, raw: true}, function (err, value) { + if (err && /^Param 0/.test(err.message)) { + return sbot.get(id, cb) + } + cb(err, value) + }) + } catch(e) { + cb(e) + } } function getMsgWithValue(sbot, id, cb) { |