Skip to content

Commit b13a54c

Browse files
Matched method name in error with actual method's name (#2000)
* Matched function name in error with actual function * matched the interface names * fixed test failing due to error rename Co-authored-by: Steven Gum <[email protected]>
1 parent 2192fb8 commit b13a54c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export class OAuthPrompt extends Dialog {
264264
private async sendOAuthCardAsync(context: TurnContext, prompt?: string|Partial<Activity>): Promise<void> {
265265
// Validate adapter type
266266
if (!('getUserToken' in context.adapter)) {
267-
throw new Error(`OAuthPrompt.prompt(): not supported for the current adapter.`);
267+
throw new Error(`OAuthPrompt.sendOAuthCardAsync(): not supported for the current adapter.`);
268268
}
269269

270270
// Initialize outgoing message
@@ -364,8 +364,8 @@ export class OAuthPrompt extends Dialog {
364364
// Token Exchange not supported in the adapter
365365
await context.sendActivity(this.getTokenExchangeInvokeResponse(
366366
StatusCodes.BAD_GATEWAY,
367-
'The bot\'s BotAdapter does not support token exchange operations. Ensure the bot\'s Adapter supports the ITokenExchangeProvider interface.'));
368-
throw new Error('OAuthPrompt.recognize(): not supported by the current adapter');
367+
'The bot\'s BotAdapter does not support token exchange operations. Ensure the bot\'s Adapter supports the ExtendedUserTokenProvider interface.'));
368+
throw new Error('OAuthPrompt.recognizeToken(): not supported by the current adapter');
369369
} else {
370370
// No errors. Proceed with token exchange
371371
const extendedUserTokenProvider : ExtendedUserTokenProvider = context.adapter as ExtendedUserTokenProvider;

libraries/botbuilder-dialogs/tests/oauthPrompt.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ describe('OAuthPrompt', function() {
319319
try {
320320
await prompt.sendOAuthCardAsync(context);
321321
} catch (e) {
322-
assert.strictEqual(e.message, `OAuthPrompt.prompt(): not supported for the current adapter.`);
322+
assert.strictEqual(e.message, `OAuthPrompt.sendOAuthCardAsync(): not supported for the current adapter.`);
323323
}
324324
});
325325

0 commit comments

Comments
 (0)