We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3721d3e commit cc5c279Copy full SHA for cc5c279
app.js
@@ -41,11 +41,18 @@ var cio = function (user, key) {
41
text: input
42
}}, function (err, httpResponse, body) {
43
if (err) throw err;
44
- if (JSON.parse(body).status == "success") {
45
- callback(false, JSON.parse(body).response);
+ try
+ {
46
+ if (JSON.parse(body).status == "success") {
47
+ callback(false, JSON.parse(body).response);
48
+ }
49
+ else {
50
+ callback(true, JSON.parse(body).status);
51
52
}
- else {
- callback(true, JSON.parse(body).status);
53
+ catch(e)
54
55
+ console.log(e);
56
57
});
58
0 commit comments