8000 added file argument in on_error_calls · zigri2612/botbuilder-python@52fb7d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 52fb7d4

Browse files
committed
added file argument in on_error_calls
1 parent a078008 commit 52fb7d4

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

samples/Core-Bot/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import yaml
99
import os
10+
import sys
1011
from aiohttp import web
1112
from botbuilder.schema import (Activity, ActivityTypes)
1213
from botbuilder.core import (BotFrameworkAdapter, BotFrameworkAdapterSettings, TurnContext,
@@ -30,7 +31,7 @@ async def on_error(context: TurnContext, error: Exception):
3031
# This check writes out errors to console log
3132
# NOTE: In production environment, you should consider logging this to Azure
3233
# application insights.
33-
print(f'\n [on_turn_error]: { error }')
34+
print(f'\n [on_turn_error]: { error }', file=sys.stderr)
3435
# Send a message to the user
3536
await context.send_activity('Oops. Something went wrong!')
3637
# Clear out state

samples/Rich-Cards-Bot/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77
import os
88
import yaml
9+
import sys
910

1011
from aiohttp import web
1112
from botbuilder.schema import Activity, ActivityTypes
@@ -29,7 +30,7 @@ async def on_error(context: TurnContext, error: Exception):
2930
# This check writes out errors to console log
3031
# NOTE: In production environment, you should consider logging this to Azure
3132
# application insights.
32-
print(f'\n [on_turn_error]: { error }')
33+
print(f'\n [on_turn_error]: { error }', file=sys.stderr)
3334
# Send a message to the user
3435
await context.send_activity('Oops. Something went wrong!')
3536
# Clear out state

samples/State-Management-Bot/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77
import os
88
import yaml
9+
import sys
910

1011
from aiohttp import web
1112
from botbuilder.schema import Activity, ActivityTypes
@@ -28,7 +29,7 @@ async def on_error(context: TurnContext, error: Exception):
2829
# This check writes out errors to console log
2930
# NOTE: In production environment, you should consider logging this to Azure
3031
# application insights.
31-
print(f'\n [on_turn_error]: { error }')
32+
print(f'\n [on_turn_error]: { error }', file=sys.stderr)
3233
# Send a message to the user
3334
await context.send_activity('Oops. Something went wrong!')
3435
# Clear out state

samples/python-flask/13.core-bot/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from functools import wraps
1414
import json
1515
import asyncio
16+
import sys
1617
from flask import Flask, jsonify, request, Response
1718
from botbuilder.schema import (Activity, ActivityTypes)
1819
from botbuilder.core import (BotFrameworkAdapter, BotFrameworkAdapterSettings, TurnContext,
@@ -34,7 +35,7 @@ async def on_error(context: TurnContext, error: Exception):
3435
# This check writes out errors to console log
3536
# NOTE: In production environment, you should consider logging this to Azure
3637
# application insights.
37-
print(f'\n [on_turn_error]: { error }')
38+
print(f'\n [on_turn_error]: { error }', file=sys.stderr)
3839
# Send a message to the user
3940
await context.send_activity('Oops. Something went wrong!')
4041
# Clear out state

0 commit comments

Comments
 (0)
0