mirror of
https://github.com/django/daphne.git
synced 2024-11-21 23:46:33 +03:00
Add logger traceback on application error. (#308)
This commit is contained in:
parent
18f2d67f34
commit
61c8633c5d
|
@ -21,7 +21,6 @@ else:
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
import traceback
|
|
||||||
from concurrent.futures import CancelledError
|
from concurrent.futures import CancelledError
|
||||||
|
|
||||||
from twisted.internet import defer, reactor
|
from twisted.internet import defer, reactor
|
||||||
|
@ -283,13 +282,10 @@ class Server(object):
|
||||||
# Protocol is asking the server to exit (likely during test)
|
# Protocol is asking the server to exit (likely during test)
|
||||||
self.stop()
|
self.stop()
|
||||||
else:
|
else:
|
||||||
exception_output = "{}\n{}{}".format(
|
|
||||||
exception,
|
|
||||||
"".join(traceback.format_tb(exception.__traceback__)),
|
|
||||||
" {}".format(exception),
|
|
||||||
)
|
|
||||||
logger.error(
|
logger.error(
|
||||||
"Exception inside application: %s", exception_output
|
"Exception inside application: %s",
|
||||||
|
exception,
|
||||||
|
exc_info=exception,
|
||||||
)
|
)
|
||||||
if not disconnected:
|
if not disconnected:
|
||||||
protocol.handle_exception(exception)
|
protocol.handle_exception(exception)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user