Skip to content

Conversation

@professorhaseeb
Copy link
Contributor

Description

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

when sentry dsn is removed from env, production gives erro
solution: set a default on sentry env

browniebroke
browniebroke previously approved these changes Nov 24, 2025
@browniebroke
Copy link
Member

I see where you're coming from, however if I answer "use sentry=y", I would rather have the app crash loudly if I forget to set the env variable that silently not send crash reports where I'm expecting them (in Sentry).

@professorhaseeb
Copy link
Contributor Author

In my case i created the project with use sentry=y, but i never added the dsn url, and it never gave any error

@browniebroke
Copy link
Member

I'm confused... In the PR description, you say the opposite:

when sentry dsn is removed from env, production gives erro

I think this is the behaviour:

  • Without default, an error is raised to flag explicitly the missing value from env, which - makes the problem clear. This is how it works on main and my preference
  • With default=None, if the env variable for the DSN is misconfigured (e.g typo in the name), the problem is silently ignored, and Sentry won't work. It also enables you to skip Sentry configuration, as you did.

Is my understanding correct? Let me know if I'm missing something

@professorhaseeb
Copy link
Contributor Author

professorhaseeb commented Nov 27, 2025

what happened in my scenario is i had the project setup as sentry=y, and i never added the variable for sentry dsn in production.

i then later added the sentry dsn and deployed production again. everything was fine,
later i removed sentry dns and deployed production again, and i got the error. which when i set default=None it worked

@professorhaseeb
Copy link
Contributor Author

Without default, an error is raised to flag explicitly the missing value from env, which - makes the problem clear. This is how it works on main and my preference

without default it never gave me any error.

after setting dsn variable - no error
removing dns variable - error
adding default - no error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants