diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 69a6cc413..cce7da9ac 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -1191,11 +1191,20 @@ if(cb) { xhr.onload = function() { - console.log("response text" + this.responseText); - cb(null,{ - status:this.status, - data:JSON.parse(this.responseText) - }) + try { + err = null + res = { + status:this.status, + data: JSON.parse(this.responseText) + } + } catch(e) { + err = { + message:"Failed to parse JSON", + raw:this.responseText + } + res = null + } + cb(err,res) } xhr.onerror = function() { cb({ diff --git a/main/lib/urb.js b/main/lib/urb.js index 8c964985d..919ccb0f4 100644 --- a/main/lib/urb.js +++ b/main/lib/urb.js @@ -29,7 +29,6 @@ window.urb.send = function(params,cb) { } window.urb.subscribe = function(params,cb) { - console.log("Someone is subscribing"); if(!cb) throw new Error("You must supply a callback to urb.subscribe.") if(!params)