From 6d6cfacdc879419f46fba4ef6fc581fd00b1bfe6 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 31 Mar 2015 21:52:00 +0200 Subject: [PATCH] Turn off crash report if raven not available Fix #121 --- gns3server/crash_report.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 8373d1d7..c22b0126 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -15,12 +15,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import raven import os import sys import struct import platform +try: + import raven + RAVEN_AVAILABLE = True +except ImportError: + # raven is not installed with deb package in order to simplify packagin + RAVEN_AVAILABLE = False + from .version import __version__ from .config import Config @@ -47,6 +53,8 @@ class CrashReport: self._client = None def capture_exception(self, request=None): + if not RAVEN_AVAILABLE: + return server_config = Config.instance().get_section_config("Server") if server_config.getboolean("report_errors"): if self._client is None: