Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrown authored May 14, 2019
2 parents 657af21 + 3c3ff5d commit 693a9db
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
3 changes: 1 addition & 2 deletions packages/botbuilder-adapter-facebook/src/facebook_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ export class FacebookAdapter extends BotAdapter {
}

const context = new TurnContext(this, activity as Activity);
await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);
}

/*
Expand Down
3 changes: 1 addition & 2 deletions packages/botbuilder-adapter-hangouts/src/hangouts_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ export class HangoutsAdapter extends BotAdapter {
context.turnState.set('httpStatus', 200);
}

await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);

if (event.type === 'CARD_CLICKED') {
// send http response back
Expand Down
9 changes: 3 additions & 6 deletions packages/botbuilder-adapter-slack/src/slack_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ export class SlackAdapter extends BotAdapter {

context.turnState.set('httpStatus', 200);

await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);

// send http response back
res.status(context.turnState.get('httpStatus'));
Expand Down Expand Up @@ -569,8 +568,7 @@ export class SlackAdapter extends BotAdapter {

context.turnState.set('httpStatus', 200);

await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);

// send http response back
res.status(context.turnState.get('httpStatus'));
Expand Down Expand Up @@ -618,8 +616,7 @@ export class SlackAdapter extends BotAdapter {

context.turnState.set('httpStatus', 200);

await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);

// send http response back
res.status(context.turnState.get('httpStatus'));
Expand Down
3 changes: 1 addition & 2 deletions packages/botbuilder-adapter-twilio-sms/src/twilio_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ export class TwilioAdapter extends BotAdapter {

context.turnState.set('httpStatus', 200);

await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);

// send http response back
res.status(context.turnState.get('httpStatus'));
Expand Down
5 changes: 2 additions & 3 deletions packages/botbuilder-adapter-web/src/web_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class WebAdapter extends BotAdapter {
if (channel === 'websocket') {
// If this turn originated with a websocket message, respond via websocket
var ws = clients[activity.recipient.id];
if (ws) {
if (ws && ws.readyState === 1) {
try {
ws.send(JSON.stringify(message));
} catch (err) {
Expand Down Expand Up @@ -294,8 +294,7 @@ export class WebAdapter extends BotAdapter {

context.turnState.set('httpStatus', 200);

await this.runMiddleware(context, logic)
.catch((err) => { throw err; });
await this.runMiddleware(context, logic);

// send http response back
res.status(context.turnState.get('httpStatus'));
Expand Down
4 changes: 2 additions & 2 deletions packages/botkit/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ export class Botkit {
const dialogContext = await this.dialogSet.createContext(turnContext);

// Spawn a bot worker with the dialogContext
const bot = await this.spawn(dialogContext).catch((err) => { throw err; });
const bot = await this.spawn(dialogContext);

// Turn this turnContext into a Botkit message.
const message: BotkitMessage = {
Expand Down Expand Up @@ -1032,7 +1032,7 @@ export class Botkit {
* for handling platform-specific events or activities.
* @param config {any} Preferably receives a DialogContext, though can also receive a TurnContext. If excluded, must call `bot.changeContext(reference)` before calling any other method.
*/
public async spawn(config: any): Promise<BotWorker> {
public async spawn(config?: any): Promise<BotWorker> {
if (config instanceof TurnContext) {
config = {
dialogContext: await this.dialogSet.createContext(config as TurnContext),
Expand Down

0 comments on commit 693a9db

Please sign in to comment.