From 6db2467ce812ea6edae63ea0ab158c07e7ee293b Mon Sep 17 00:00:00 2001
From: Martin Bernstorff <martinbernstorff@gmail.com>
Date: Sat, 23 Dec 2023 14:15:32 +0000
Subject: [PATCH 1/2] feat: add sentry_dsn flag which enables/disables sentry.

Fixes #421
---
 personal_mnemonic_medium/cli.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/personal_mnemonic_medium/cli.py b/personal_mnemonic_medium/cli.py
index eee8b82d..a72564d4 100644
--- a/personal_mnemonic_medium/cli.py
+++ b/personal_mnemonic_medium/cli.py
@@ -45,6 +45,12 @@ def cli(
             help="Don't update via AnkiConnect, just log what would happen"
         ),
     ] = False,
+    sentry_dsn: Annotated[
+        Optional[str],  # noqa: UP007
+        typer.Option(
+            help="Sentry DSN for error reporting. If not provided, no error reporting will be done."
+        ),
+    ] = None,
     skip_sync: Annotated[
         bool, typer.Option(help="Skip all syncing, useful for smoketest")
     ] = False,
@@ -55,10 +61,8 @@ def cli(
         datefmt="%Y/&m/%d %H:%M:%S",
     )
 
-    sentry_sdk.init(
-        dsn="https://37f17d6aa7742424652663a04154e032@o4506053997166592.ingest.sentry.io/4506053999984640",
-        environment=get_env(default="None"),
-    )
+    if sentry_dsn:
+        sentry_sdk.init(dsn=sentry_dsn, environment=get_env(default="None"))
 
     if not skip_sync:
         main(

From 9c45c7b9192eff0fbb0ee9d8eb3491f20d04056e Mon Sep 17 00:00:00 2001
From: Martin Bernstorff <martinbernstorff@gmail.com>
Date: Sat, 23 Dec 2023 14:15:32 +0000
Subject: [PATCH 2/2] feat: add sentry_dsn flag which enables/disables sentry.

Fixes #421