[PATCH 3 of 4 sentry] Don't try to initialize sentry is dsn is None or empty string

Philippe Pepiot philippe.pepiot at logilab.fr
Fri Sep 13 15:25:09 CEST 2019


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1568380686 -7200
#      Fri Sep 13 15:18:06 2019 +0200
# Node ID 9abbf4ab792f6a41a2f017dbd819c82ca71cd637
# Parent  892ab0c45296754d6dfcebd549ef0cd3cb01917f
# Available At https://hg.logilab.org/review/cubes/sentry
#              hg pull https://hg.logilab.org/review/cubes/sentry -r 9abbf4ab792f
Don't try to initialize sentry is dsn is None or empty string

diff --git a/cubicweb_sentry/__init__.py b/cubicweb_sentry/__init__.py
--- a/cubicweb_sentry/__init__.py
+++ b/cubicweb_sentry/__init__.py
@@ -12,6 +12,8 @@ def init_sdk(cwconfig, *integrations):
         dsn = cwconfig['sentry-dsn']
     except (optparse.OptionError, KeyError):
         return
+    if not dsn:
+        return
     release = cwconfig.cube_version(cwconfig.cubes()[0])
     log_level = cwconfig['sentry-log-level']
     integrations = list(integrations)



More information about the cubicweb-devel mailing list