mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
parent
46b0ead329
commit
16f6fe9d3b
@ -38,11 +38,12 @@ class CrashReport:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._client = None
|
self._client = None
|
||||||
|
|
||||||
def capture_exception(self, request):
|
def capture_exception(self, request=None):
|
||||||
server_config = Config.instance().get_section_config("Server")
|
server_config = Config.instance().get_section_config("Server")
|
||||||
if server_config.getboolean("report_errors"):
|
if server_config.getboolean("report_errors"):
|
||||||
if self._client is None:
|
if self._client is None:
|
||||||
self._client = raven.Client(CrashReport.DSN, release=__version__)
|
self._client = raven.Client(CrashReport.DSN, release=__version__)
|
||||||
|
if request is not None:
|
||||||
self._client.http_context({
|
self._client.http_context({
|
||||||
"method": request.method,
|
"method": request.method,
|
||||||
"url": request.path,
|
"url": request.path,
|
||||||
|
@ -178,7 +178,7 @@ def main():
|
|||||||
server.run()
|
server.run()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.critical("Critical error while running the server: {}".format(e), exc_info=1)
|
log.critical("Critical error while running the server: {}".format(e), exc_info=1)
|
||||||
# TODO: send exception to Sentry
|
CrashReport.instance().capture_exception()
|
||||||
return
|
return
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user