MSP-8520 up deps
This commit is contained in:
1 parent
c14f8441fb
commit
884aa6a439
304 files changed
+18223
-4352
No files matched your search
+16
@@ -33,6 +33,7 @@ func NewStacktrace() *Stacktrace {
|
||||
}
|
||||
|
||||
runtimeFrames := extractFrames(pcs[:n])
|
||||
runtimeFrames = trimPanicFrames(runtimeFrames)
|
||||
frames := createFrames(runtimeFrames)
|
||||
|
||||
stacktrace := Stacktrace{
|
||||
@@ -282,6 +283,21 @@ func extractFrames(pcs []uintptr) []runtime.Frame {
|
||||
return frames
|
||||
}
|
||||
|
||||
// trimPanicFrames removes frames added while handling an active panic.
|
||||
//
|
||||
// The runtime.gopanic frame indicates the part of the code that caused the panic.
|
||||
// This is helpful for skipping any wrapper code that was used to handle and recover
|
||||
// from the panic, so that we only keep the relevant frames.
|
||||
func trimPanicFrames(frames []runtime.Frame) []runtime.Frame {
|
||||
for i := len(frames) - 1; i >= 0; i-- {
|
||||
if frames[i].Function == "runtime.gopanic" {
|
||||
return frames[:i]
|
||||
}
|
||||
}
|
||||
|
||||
return frames
|
||||
}
|
||||
|
||||
// createFrames creates Frame objects while filtering out frames that are not
|
||||
// meant to be reported to Sentry, those are frames internal to the SDK or Go.
|
||||
func createFrames(frames []runtime.Frame) []Frame {
|
||||
|
||||
Reference in new issue
Block a user