Add logger traceback on application error. (#308)

This commit is contained in:
LittlePony 2020-02-05 22:40:44 +03:00 committed by GitHub
parent 18f2d67f34
commit 61c8633c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,6 @@ else:
import logging
import time
import traceback
from concurrent.futures import CancelledError
from twisted.internet import defer, reactor
@ -283,13 +282,10 @@ class Server(object):
# Protocol is asking the server to exit (likely during test)
self.stop()
else:
exception_output = "{}\n{}{}".format(
exception,
"".join(traceback.format_tb(exception.__traceback__)),
" {}".format(exception),
)
logger.error(
"Exception inside application: %s", exception_output
"Exception inside application: %s",
exception,
exc_info=exception,
)
if not disconnected:
protocol.handle_exception(exception)