Browse Source

Skip init if raven is not available on the system

pull/98/head
Sandy Carter 10 years ago
parent
commit
3c63e9300d
  1. 6
      sentry_logger/__init__.py

6
sentry_logger/__init__.py

@ -26,10 +26,10 @@ import cgitb
from openerp.tools import config
from openerp.addons.web.controllers.main import Session
try:
from .odoo_sentry_client import OdooClient
from .odoo_sentry_handler import OdooSentryHandler
root_logger = logging.root
processors = (
@ -51,14 +51,14 @@ else:
root_logger.warn(u"Sentry DSN not defined in config file")
client = None
# Inject sentry_activated to session to display error message or not
old_session_info = Session.session_info
def session_info(self, req):
res = old_session_info(self, req)
res['sentry_activated'] = bool(client)
return res
Session.session_info = session_info
except ImportError:
pass
Loading…
Cancel
Save