This repository was archived by the owner on Jun 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
templates/Virtual-Assistant-Template/typescript
generator-botbuilder-assistant/generators/skill/templates/sample-skill/src/adapters
samples/sample-skill/src/adapters Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 44 */
55
66import {
7+ ActivityTypes ,
78 AutoSaveStateMiddleware ,
89 BotFrameworkAdapter ,
910 BotFrameworkAdapterSettings ,
@@ -13,6 +14,7 @@ import {
1314 TelemetryLoggerMiddleware ,
1415 TranscriptLoggerMiddleware ,
1516 TranscriptStore ,
17+ TurnContext ,
1618 UserState } from 'botbuilder' ;
1719import { AzureBlobTranscriptStore } from 'botbuilder-azure' ;
1820import {
@@ -30,6 +32,18 @@ export class DefaultAdapter extends BotFrameworkAdapter {
3032 ) {
3133 super ( adapterSettings ) ;
3234
35+ this . onTurnError = async ( context : TurnContext , error : Error ) : Promise < void > => {
36+ await context . sendActivity ( {
37+ type : ActivityTypes . Trace ,
38+ text : error . message || JSON . stringify ( error )
39+ } ) ;
40+ await context . sendActivity ( {
41+ type : ActivityTypes . Trace ,
42+ text : error . stack
43+ } ) ;
44+ telemetryClient . trackException ( { exception : error } ) ;
45+ } ;
46+
3347 if ( settings . blobStorage === undefined ) {
3448 throw new Error ( 'There is no blobStorage value in appsettings file' ) ;
3549 }
Original file line number Diff line number Diff line change 44 */
55
66import {
7+ ActivityTypes ,
78 AutoSaveStateMiddleware ,
89 BotFrameworkAdapter ,
910 BotFrameworkAdapterSettings ,
@@ -13,6 +14,7 @@ import {
1314 TelemetryLoggerMiddleware ,
1415 TranscriptLoggerMiddleware ,
1516 TranscriptStore ,
17+ TurnContext ,
1618 UserState } from 'botbuilder' ;
1719import { AzureBlobTranscriptStore } from 'botbuilder-azure' ;
1820import {
@@ -30,6 +32,18 @@ export class DefaultAdapter extends BotFrameworkAdapter {
3032 ) {
3133 super ( adapterSettings ) ;
3234
35+ this . onTurnError = async ( context : TurnContext , error : Error ) : Promise < void > => {
36+ await context . sendActivity ( {
37+ type : ActivityTypes . Trace ,
38+ text : error . message || JSON . stringify ( error )
39+ } ) ;
40+ await context . sendActivity ( {
41+ type : ActivityTypes . Trace ,
42+ text : error . stack
43+ } ) ;
44+ telemetryClient . trackException ( { exception : error } ) ;
45+ } ;
46+
3347 if ( settings . blobStorage === undefined ) {
3448 throw new Error ( 'There is no blobStorage value in appsettings file' ) ;
3549 }
You can’t perform that action at this time.
0 commit comments