mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Do not send garbage to console in case of sentry not available
This commit is contained in:
parent
16dc0d1a8a
commit
10296f4f19
@ -43,14 +43,17 @@ class CrashReport:
|
|||||||
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__, raise_send_errors=True)
|
||||||
if request is not None:
|
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,
|
||||||
"data": request.json,
|
"data": request.json,
|
||||||
})
|
})
|
||||||
|
try:
|
||||||
self._client.captureException()
|
self._client.captureException()
|
||||||
|
except Exception as e:
|
||||||
|
log.error("Can't send crash report to Sentry: %s", e)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def instance(cls):
|
def instance(cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user