Missing DSN causes exception rather than silently doing nothing #9290
Labels
Platform: .NET
Team: Web Backend SDKs
team-web-sdk-backend
Type: Content
Issues about the contents of our docs
Core or SDK?
Core Sentry product
Which part? Which one?
.NET SDK 4.1.2
Description
This says
I have found this not to be the case.
I copied the code example on that page, and it works fine.
If I set
SENTRY_DSN
variable in my environment, and remove the explicitoptions.Dsn = ...
from the code, it still works fine, using the DSN from the env var.If I remove the explicit
options.Dsn = ...
from the code and do not set any environment variable, I get an unhandled ArgumentNullException and my application crashes at startup. It does not fall back to the 'just do nothing' behaviour that is documented.I'm not sure if this is a documentation problem, or a bug in the SDK. I see someone has reported a bug here and there is a possible fix here, but it sounds like the fix might already be in the version I was using?
Suggested Solution
It would suit me best if the code behaves exactly as documented. Failing that, the docs should match the code behaviour so I can work out what to do in my situation.
The text was updated successfully, but these errors were encountered: