Skip to content

Commit 22fbbf8

Browse files
committed
amend(3abc954): show in-app error in debug mode
1 parent d253e32 commit 22fbbf8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pywebio/platform/path_deploy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .tornado import webio_handler, set_ioloop
1414
from .tornado_http import TornadoHttpContext
1515
from .utils import cdn_validation, make_applications
16-
from ..session import register_session_implement, CoroutineBasedSession, ThreadBasedSession
16+
from ..session import register_session_implement, CoroutineBasedSession, ThreadBasedSession, Session
1717
from ..utils import get_free_port, STATIC_PATH, parse_file_size
1818

1919

@@ -245,7 +245,7 @@ def path_deploy(base, port=0, host='',
245245
246246
The rest arguments of ``path_deploy()`` have the same meaning as for :func:`pywebio.platform.tornado.start_server`
247247
"""
248-
248+
debug = Session.debug = os.environ.get('PYWEBIO_DEBUG', debug)
249249
utils.MAX_PAYLOAD_SIZE = max_payload_size = parse_file_size(max_payload_size)
250250
# Since some cloud server may close idle connections (such as heroku),
251251
# use `websocket_ping_interval` to keep the connection alive
@@ -301,6 +301,8 @@ def path_deploy_http(base, port=0, host='',
301301
302302
The rest arguments of ``path_deploy_http()`` have the same meaning as for :func:`pywebio.platform.tornado_http.start_server`
303303
"""
304+
debug = Session.debug = os.environ.get('PYWEBIO_DEBUG', debug)
305+
304306
utils.MAX_PAYLOAD_SIZE = max_payload_size = parse_file_size(max_payload_size)
305307

306308
gen = _path_deploy(base, port=port, host=host,

0 commit comments

Comments
 (0)