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

Add Meta information to Exception Mechanism #965

Open
TyPh00nCdr opened this issue Feb 3, 2025 · 4 comments
Open

Add Meta information to Exception Mechanism #965

TyPh00nCdr opened this issue Feb 3, 2025 · 4 comments

Comments

@TyPh00nCdr
Copy link

Problem Statement

Pull request #606 already added support for a number of non-golang event interfaces. It is, however, missing the meta interface on the exception mechanism. (See Sentry SDK dev docs).

Could this also be added?

Solution Brainstorm

type Meta struct {
	Signal        *Signal        `json:"signal,omitempty"`         // Information on the POSIX signal.
	MachException *MachException `json:"mach_exception,omitempty"` // A Mach Exception on Apple systems comprising a code triple and optional descriptions.
	NSError       *NSError       `json:"ns_error,omitempty"`       // An NSError on Apple systems comprising domain and code.
	ErrNo         *ErrNo         `json:"errno,omitempty"`          // Error codes set by Linux system calls and some library functions.
}

type Signal struct {
	Number   int     `json:"number"`              // POSIX signal number
	Code     *int    `json:"code,omitempty"`      // Optional Apple signal code
	Name     *string `json:"name,omitempty"`      // Optional name of the signal based on the signal number.
	CodeName *string `json:"code_name,omitempty"` // Optional name of the signal code.
}

type MachException struct {
	Code      int     `json:"code"`           // Required numeric exception code.
	SubCode   int64   `json:"subcode"`        // Required numeric exception subcode.
	Exception int     `json:"exception"`      // Required numeric exception number.
	Name      *string `json:"name,omitempty"` // Optional name of the exception constant in iOS / macOS.
}

type NSError struct {
	Code   int    `json:"code"`   // Required numeric error code.
	Domain string `json:"domain"` // Required domain of the NSError as string.
}

type ErrNo struct {
	Number int     `json:"number"`         // The error number
	Name   *string `json:"name,omitempty"` // Optional name of the error
}
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 3, 2025
@cleptric
Copy link
Member

cleptric commented Feb 5, 2025

What would be your use-case for adding these?

@TyPh00nCdr
Copy link
Author

What would be your use-case for adding these?

Same as for #606: Proxying non-golang errors. Since you already added non-golang error interfaces in that PR, I think it's sensible to add the remaining ones and close the gap.

Specifically, I want to proxy iOS errors and cannot use the cocoa Sentry SDK for it.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 5, 2025
@cleptric
Copy link
Member

cleptric commented Feb 5, 2025

Sure, this makes sense to me. PRs are welcome; otherwise, I'll try to add this in the next few weeks.

Specifically, I want to proxy iOS errors and cannot use the cocoa Sentry SDK for it.

Feel free to drop us an issue on https://github.com/getsentry/sentry-cocoa in case something is missing.

@TyPh00nCdr
Copy link
Author

Feel free to drop us an issue on https://github.com/getsentry/sentry-cocoa in case something is missing.

The use-case for that is supporting telemetry from an iOS Framework (Apple's term for an SDK). But since Sentry-cocoa doesn't support multiple instances, only a global one, you would clash with the potential instance of the Framework's user's code (if they use Sentry that is).

PRs are welcome

I'd love to add it, but don't know if I'll find the time anytime soon. If you'd want to wait for it, I might find some free time in the next months or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants