Skip to content

Commit

Permalink
Adding missing error parameter to callback (#156)
Browse files Browse the repository at this point in the history
Also logs errors to the console.
  • Loading branch information
rickydunlop authored and NimJay committed Nov 10, 2022
1 parent 17710a5 commit dc7b876
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cloud-language/snippets/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ if (require.main === module) {
'Usage: node analyze.js <sentiment|entities|syntax> <text>');
process.exit(1);
}
exports.main(args[0], args[1], function (result) {
exports.main(args[0], args[1], function (err, result) {
if (err) {
console.error(err);
}
console.log(JSON.stringify(result, null, ' '));
});
}

0 comments on commit dc7b876

Please sign in to comment.