From 10296f4f193b111849978a9639426fbe6bb7d7c6 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 3 Mar 2015 13:04:30 +0100 Subject: [PATCH] Do not send garbage to console in case of sentry not available --- gns3server/crash_report.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 49f7f404..099ab28a 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -43,14 +43,17 @@ class CrashReport: server_config = Config.instance().get_section_config("Server") if server_config.getboolean("report_errors"): 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: self._client.http_context({ "method": request.method, "url": request.path, "data": request.json, }) - self._client.captureException() + try: + self._client.captureException() + except Exception as e: + log.error("Can't send crash report to Sentry: %s", e) @classmethod def instance(cls):