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

Remove useless catch-throw blocks #1654

Merged
merged 2 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 deletions packages/botbuilder-adapter-web/src/web_adapter.ts
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion 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