mirror of
https://github.com/openobserve/goflow2.git
synced 2025-11-03 13:33:14 +00:00
feat: handle panic (#254)
This commit is contained in:
23
utils/debug/debug.go
Normal file
23
utils/debug/debug.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package debug
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
PanicError = fmt.Errorf("panic")
|
||||
)
|
||||
|
||||
type PanicErrorMessage struct {
|
||||
Msg interface{}
|
||||
Inner string
|
||||
Stacktrace []byte
|
||||
}
|
||||
|
||||
func (e *PanicErrorMessage) Error() string {
|
||||
return fmt.Sprintf("%s", e.Inner)
|
||||
}
|
||||
|
||||
func (e *PanicErrorMessage) Unwrap() []error {
|
||||
return []error{PanicError}
|
||||
}
|
||||
Reference in New Issue
Block a user