Skip to content

Commit

Permalink
feat: add sentry_dsn flag which enables/disables sentry. (#437)
Browse files Browse the repository at this point in the history
feat: add sentry_dsn flag which enables/disables sentry.

Fixes #421

feat: add sentry_dsn flag which enables/disables sentry.

Fixes #421
  • Loading branch information
MartinBernstorff authored Dec 23, 2023
2 parents 12a9e9f + 9c45c7b commit 7e001cf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions personal_mnemonic_medium/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit 7e001cf

Please sign in to comment.