1
1
mirror of https://github.com/walles/moar.git synced 2024-11-27 01:05:23 +03:00
moar/m/panicHandler.go
2024-08-12 21:47:46 +02:00

19 lines
388 B
Go

package m
// NOTE: This file should be identical to twin/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)
}