Skip to content

Commit ad37e8d

Browse files
Merge branch 'master' into update-context-docs
2 parents 508b040 + 046f901 commit ad37e8d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/index.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ export class WatsonMiddleware {
161161

162162
const watsonRequest = await this.before(message, payload);
163163
let watsonResponse = await postMessage(this.conversation, watsonRequest);
164+
if (typeof watsonResponse.output.error === 'string') {
165+
debug('Error: %s', watsonResponse.output.error);
166+
message.watsonError = watsonResponse.output.error;
167+
}
164168
watsonResponse = await this.after(message, watsonResponse);
165169

166170
message.watsonData = watsonResponse;

0 commit comments

Comments
 (0)