getsentry / getsentry/sentry-go

Add Meta information to Exception Mechanism

Open
#965 4 comments 0 reactions 0 assignees View on GitHub
Errors Feature Go
Dominant language
Go
Stars
1.1k
Forks
262
Avg merge
1d 48m
Merged PRs (30d)
7

Description

### 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](https://develop.sentry.dev/sdk/data-model/event-payloads/exception/#meta-information)).

Could this also be added?

### Solution Brainstorm

```go
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
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.