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

Commit

Permalink
Merge pull request #1654 from Naktibalda/remove-catch-throw
Browse files Browse the repository at this point in the history
Remove useless catch-throw blocks
  • Loading branch information
benbrown authored May 14, 2019
2 parents 976d310 + 1e60a31 commit 3c3ff5d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 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
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

0 comments on commit 3c3ff5d

Please sign in to comment.