no console logs in production

This commit is contained in:
Galen Wolfe-Pauly 2014-08-11 12:57:25 -07:00
parent 7c543b2f22
commit db727ccf13
2 changed files with 14 additions and 6 deletions

View File

@ -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({

View File

@ -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)