Do not send garbage to console in case of sentry not available

This commit is contained in:
Julien Duponchelle 2015-03-03 13:04:30 +01:00
parent 16dc0d1a8a
commit 10296f4f19

View File

@ -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,
}) })
self._client.captureException() try:
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):