mirror of
https://github.com/walles/moar.git
synced 2024-11-27 01:05:23 +03:00
19 lines
388 B
Go
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)
|
|
}
|