MCPcopy Index your code
hub / github.com/koding/kite / onError

Function onError

client.go:1003–1032  ·  view source on GitHub ↗

onError is called when an error happened in a method handler.

(err error)

Source from the content-addressed store, hash-verified

1001
1002// onError is called when an error happened in a method handler.
1003func onError(err error) {
1004 // TODO do not marshal options again here
1005 switch e := err.(type) {
1006 case dnode.MethodNotFoundError: // Tell the requester "method is not found".
1007 args, err2 := e.Args.Slice()
1008 if err2 != nil {
1009 return
1010 }
1011
1012 if len(args) < 1 {
1013 return
1014 }
1015
1016 var options callOptions
1017 if err := args[0].Unmarshal(&options); err != nil {
1018 return
1019 }
1020
1021 if options.ResponseCallback.Caller != nil {
1022 response := Response{
1023 Result: nil,
1024 Error: &Error{
1025 Type: "methodNotFound",
1026 Message: err.Error(),
1027 },
1028 }
1029 options.ResponseCallback.Call(response)
1030 }
1031 }
1032}
1033
1034type lockedBackoff struct {
1035 mu sync.Mutex

Callers 1

processMessageMethod · 0.85

Calls 4

SliceMethod · 0.80
UnmarshalMethod · 0.80
ErrorMethod · 0.65
CallMethod · 0.65

Tested by

no test coverage detected