mirror of
https://github.com/walles/moar.git
synced 2024-11-22 03:14:56 +03:00
19 lines
388 B
Go
19 lines
388 B
Go
package twin
|
|
|
|
// NOTE: This file should be identical to m/panicHandler.go
|
|
|
|
import (
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func panicHandler(goroutineName string, recoverResult any, stackTrace []byte) {
|
|
if recoverResult == nil {
|
|
return
|
|
}
|
|
|
|
log.WithFields(log.Fields{
|
|
"panic": recoverResult,
|
|
"stackTrace": string(stackTrace),
|
|
}).Error("Goroutine panicked: " + goroutineName)
|
|
}
|