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

Displaying error name instead of Error code #2958

Closed
arielelkin opened this issue Apr 19, 2023 · 5 comments · Fixed by #2960
Closed

Displaying error name instead of Error code #2958

arielelkin opened this issue Apr 19, 2023 · 5 comments · Fixed by #2960

Comments

@arielelkin
Copy link

Problem Statement

We are tracking errors in our macOS app using Sentry. Our errors are usually represented by Swift or C enums.

When they get reported, we just see the numerical error code rather than the error name. This means we need to then go look up the precise error name.

For example:
image

is reported as "com.firebase.appCheck Code: 0", but to know what Code 0 means we need to look up that error enum.
Is there a way to display the error name rather than the numerical error code in Sentry ?

Thanks

Solution Brainstorm

Since we pass the error object to the sentry SDK, the sentry SDK should report the enum's value (via introspection) and its localizedDescription(if any).

@getsantry
Copy link

getsantry bot commented Apr 19, 2023

Assigning to @getsentry/support for routing, due by Thursday, April 20th at 10:13 am (sfo). ⏲️

@getsantry
Copy link

getsantry bot commented Apr 20, 2023

Routing to @getsentry/team-mobile for triage, due by Monday, April 24th at 9:18 am (sfo). ⏲️

@philipphofmann
Copy link
Member

Hey @arielelkin, did you check out our custom error descriptions? Please reopen this issue, if it doesn't solve your problem.

@arielelkin
Copy link
Author

@philipphofmann thanks for your response. Unfortunately custom error descriptions are not a viable suggestion, as we have hundreds of different errors; this involves creating a lookup table of error codes and duplicating their names just for the sake of reporting them to Sentry.

Could you please re-open the issue? I don't have the option on my side.

@philipphofmann philipphofmann transferred this issue from getsentry/sentry Apr 25, 2023
@philipphofmann philipphofmann moved this from Needs Discussion to In Progress in Mobile & Cross Platform SDK Apr 25, 2023
@philipphofmann philipphofmann self-assigned this Apr 25, 2023
philipphofmann added a commit that referenced this issue Apr 25, 2023
Call into Swift to get the error description for Swift errors to
get meaningful error names instead of only the error enum code.
To avoid sending PII the SDK strips parameter values and doesn't
send the swift error name for struct based Swift errors.

Fixes GH-2958
philipphofmann added a commit that referenced this issue Apr 25, 2023
Call into Swift to get the error description for Swift errors to
get meaningful error names instead of only the error enum code.
To avoid sending PII the SDK strips parameter values and doesn't
send the swift error name for struct based Swift errors.

Fixes GH-2958
@philipphofmann
Copy link
Member

@arielelkin, #2960 should solve your problem. It would be great if you could give us some feedback before we merge the PR.

philipphofmann added a commit that referenced this issue May 3, 2023
Call into Swift to get the error description for Swift errors to
get meaningful error names instead of only the error enum code.

Fixes GH-2958
@github-project-automation github-project-automation bot moved this from In Progress to Done in Mobile & Cross Platform SDK May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants