mirror of
https://github.com/distribution/distribution.git
synced 2025-09-10 19:29:33 +00:00
27
vendor/github.com/bugsnag/bugsnag-go/panicwrap.go
generated
vendored
Normal file
27
vendor/github.com/bugsnag/bugsnag-go/panicwrap.go
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// +build !appengine
|
||||
|
||||
package bugsnag
|
||||
|
||||
import (
|
||||
"github.com/bugsnag/panicwrap"
|
||||
"github.com/bugsnag/bugsnag-go/errors"
|
||||
)
|
||||
|
||||
// NOTE: this function does not return when you call it, instead it
|
||||
// re-exec()s the current process with panic monitoring.
|
||||
func defaultPanicHandler() {
|
||||
defer defaultNotifier.dontPanic()
|
||||
|
||||
err := panicwrap.BasicMonitor(func(output string) {
|
||||
toNotify, err := errors.ParsePanic(output)
|
||||
|
||||
if err != nil {
|
||||
defaultNotifier.Config.log("bugsnag.handleUncaughtPanic: %v", err)
|
||||
}
|
||||
Notify(toNotify, SeverityError, Configuration{Synchronous: true})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
defaultNotifier.Config.log("bugsnag.handleUncaughtPanic: %v", err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user