Skip to content

Don't cause NoMethodError when calling Sentry.* with an uninitialized SDK #1706

@st0012

Description

@st0012

It should be either no-op or raising an exception, as the SDK should always be initialized (this is a requirement across all Sentry SDKs).

I prefer raising exceptions for such condition and have proposed it in a recent discord discussion as well. But we also have methods like Sentry.capture_* that current does nothing instead of raising an exception. So my concerns are:

  • If I make methods like Sentry.set_tags raise exceptions, should I also change Sentry.capture_*'s behaviors.
  • If the answer is yes, should we consider that as a breaking change?

As maintainers we can argue that it's a bug fix so it's not a breaking change (can go out at any patch). But to some (probably few) users, it'll be a change that break their app without actually providing visible benefits to them (should be in a major release).

So I think the first step would be to stop causing the NoMethodError. And then we can discuss when to start raising the exception.

Metadata

Metadata

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions