Skip to content

Commit

Permalink
Merge pull request #128 from kata-ai/fix/handler-empty-error-return
Browse files Browse the repository at this point in the history
Handler empty error return from API converse
  • Loading branch information
adityapurwa authored Aug 30, 2019
2 parents 3d3d483 + 7ab2d5c commit a2ab390
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions components/bots/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,12 @@ export default class Bot extends Component {
let result;

promise.then((res: any) => {
done = true;
result = res;
if (res.data !== "") {
done = true;
result = res;
} else {
error = new Error("Error found. Please check your bot.");
}
}).catch((e: Error) => {
error = e;
});
Expand Down
9 changes: 7 additions & 2 deletions lib/components/bots/bot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a2ab390

Please sign in to comment.