mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-13 22:27:12 +00:00
* WIP
* WIP
* WIP
* WIP
* WIP
* Update tapRunner.go and k8sTapManager.go
* Update cleanRunner.go, common.go, and 8 more files...
* Update common.go, tapConfig.go, and 2 more files...
* Update config.go, config.go, and 5 more files...
* Update tapRunner.go, config.go, and 7 more files...
* Update cleanRunner.go, logs.go, and 2 more files...
* Update k8sTapManager.go, provider.go, and watch.go
* Update go.sum, go.mod, and go.sum
* Update go.mod and go.sum
* Update go.mod, go.sum, and 2 more files...
* Revert "Update go.mod, go.sum, and 2 more files..."
This reverts commit 8140311349
.
* Update funcWrappers.go, tapRunner.go, and 4 more files...
* Update main.go, tapRunner.go, and mizuTapperSyncer.go
27 lines
615 B
Go
27 lines
615 B
Go
package goUtils
|
|
|
|
import (
|
|
"reflect"
|
|
"runtime/debug"
|
|
|
|
"github.com/up9inc/mizu/shared/logger"
|
|
)
|
|
|
|
func HandleExcWrapper(fn interface{}, params ...interface{}) (result []reflect.Value) {
|
|
defer func() {
|
|
if panicMessage := recover(); panicMessage != nil {
|
|
stack := debug.Stack()
|
|
logger.Log.Fatalf("Unhandled panic: %v\n stack: %s", panicMessage, stack)
|
|
}
|
|
}()
|
|
f := reflect.ValueOf(fn)
|
|
if f.Type().NumIn() != len(params) {
|
|
panic("incorrect number of parameters!")
|
|
}
|
|
inputs := make([]reflect.Value, len(params))
|
|
for k, in := range params {
|
|
inputs[k] = reflect.ValueOf(in)
|
|
}
|
|
return f.Call(inputs)
|
|
}
|