sentry-go
sentry-go copied to clipboard
Add Meta information to Exception Mechanism
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
}
What would be your use-case for adding these?
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.
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.
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.