Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Severity.fromString was removed in @sentry/[email protected] #4903

Closed
3 tasks done
billyjanitsch opened this issue Apr 8, 2022 · 1 comment
Closed
3 tasks done

Comments

@billyjanitsch
Copy link

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which package are you using?

@sentry/browser

SDK Version

6.19.6

Framework Version

6.19.6

Link to Sentry event

No response

Steps to Reproduce

  1. Install @sentry/[email protected].
  2. Run the following code:
    import {Severity} from '@sentry/types'
    console.log(Severity.fromString('warn'))
  3. Install @sentry/[email protected].
  4. Run the same code.

Expected Result

On both versions, the console should print warning.

Actual Result

The Severity.fromString API was removed in 6.17.0, so the code crashes in that version and onwards.

I understand that you plan to remove the Severity enum entirely in v7 (a major release), but removing Severity.fromString in the meantime is a breaking change to a public API in a minor release.

There was discussion about this in #4280 (comment) where the consensus was to make this into an internal API, but it seems like that should have waited until v7, since in v6 the API is public. Could this API please be restored until then? Thanks!

@AbhiPrasad
Copy link
Member

Sorry for the trouble here! In the meantime, you can use

export function severityFromString(level: SeverityLevel | string): Severity {
from @sentry/utils!

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

No branches or pull requests

3 participants