Skip to content

Support Go 1.20 Unwrap() with a slice of errors #693

@ainar-g

Description

@ainar-g

Summary

Go 1.20 added another way to unwrap errors, interface { Unwrap() []error }. As far as I can see, as of now Event.SetException doesn't support it.

sentry-go/interfaces.go

Lines 356 to 363 in cda691d

switch previous := err.(type) {
case interface{ Unwrap() error }:
err = previous.Unwrap()
case interface{ Cause() error }:
err = previous.Cause()
default:
err = nil
}

Motivation

Developers are updating to Go 1.20, as Go 1.19 is EOL now, and they will expect sentry-go to support the new interface and include all errors into the event data.

Additional Context

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions