aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/app.js b/lib/app.js
index c647d39..6bfa00a 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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) {