MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / TestCustomHandleError

Function TestCustomHandleError

pkg/util/runtime/runtime_test.go:59–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestCustomHandleError(t *testing.T) {
60 old := ErrorHandlers
61 defer func() { ErrorHandlers = old }()
62 var result error
63 ErrorHandlers = []func(error){
64 func(err error) {
65 result = err
66 },
67 }
68 err := fmt.Errorf("test")
69 HandleError(err)
70 if result != err {
71 t.Errorf("did not receive custom handler")
72 }
73}
74
75func TestGetCaller(t *testing.T) {
76 tests := []struct {

Callers

nothing calls this directly

Calls 2

HandleErrorFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected