mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 20:21:20 +00:00
Add crash handler bypass for testing.
This commit is contained in:
@@ -25,8 +25,15 @@ import (
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
// For testing, bypass HandleCrash.
|
||||
var ReallyCrash bool
|
||||
|
||||
// Simply catches a crash and logs an error. Meant to be called via defer.
|
||||
func HandleCrash() {
|
||||
if ReallyCrash {
|
||||
return
|
||||
}
|
||||
|
||||
r := recover()
|
||||
if r != nil {
|
||||
callers := ""
|
||||
|
Reference in New Issue
Block a user