Skip to content

Commit

Permalink
Merge pull request #158 from ylecleach/master
Browse files Browse the repository at this point in the history
fix issue when passing context to params ; simplify error handling
  • Loading branch information
chughts committed Jul 13, 2016
2 parents 8cdb8c6 + 35f5d3b commit 09b52da
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions services/conversation/v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ module.exports = function (RED) {
if (err != null && body == null) {
node.status({fill:'red', shape:'ring',
text:'call to watson conversation service failed'});
msg.result = {};
if (err.code == null) {
msg.result['error'] = err;
} else {
msg.result['error_code'] = err.code;
if (!err.error) {
msg.result['error'] = err.error;
}
}
node.error(err);
return;
}
Expand All @@ -104,7 +95,7 @@ module.exports = function (RED) {
node.status({fill:'blue', shape:'dot' , text:'Calling Conversation service ...'});
params.workspace_id = node.workspaceid;
params.input = {text:msg.payload};
params.context =
params.context = node.context;
// call POST /message through SDK
node.service.message(params, function(err, body) {
processResponse(err,body,node,msg);
Expand Down

0 comments on commit 09b52da

Please sign in to comment.