From bccf4774a6945264b6b75d808ad699f8de060f1d Mon Sep 17 00:00:00 2001 From: Garet Halliday <me@garet.holiday> Date: Wed, 5 Jul 2023 19:16:07 -0500 Subject: [PATCH] isErrorType --- contrib/handlers/argreflect/reflect_handler.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contrib/handlers/argreflect/reflect_handler.go b/contrib/handlers/argreflect/reflect_handler.go index cf91be5..cec8616 100644 --- a/contrib/handlers/argreflect/reflect_handler.go +++ b/contrib/handlers/argreflect/reflect_handler.go @@ -66,13 +66,13 @@ func (e *callback) ServeRPC(w codec.ResponseWriter, r *codec.Request) { fullargs = append(fullargs, reflect.ValueOf(r.Context())) } fullargs = append(fullargs, args...) - //Catch panic while running the callback. + // Catch panic while running the callback. defer func() { if err := recover(); err != nil { const size = 64 << 10 buf := make([]byte, size) buf = buf[:runtime.Stack(buf, false)] - //fmt.Sprintf(`crashed: method=%s err=%v crashed=%s\n`, r.Method, err, string(buf)) + // fmt.Sprintf(`crashed: method=%s err=%v crashed=%s\n`, r.Method, err, string(buf)) // errRes := errors.New("method handler crashed: " + fmt.Sprint(err)) w.Send(nil, fmt.Errorf("%s", err)) return @@ -148,9 +148,6 @@ func (c *callback) makeArgTypes() { // Does t satisfy the error interface? func isErrorType(t reflect.Type) bool { - for t.Kind() == reflect.Ptr { - t = t.Elem() - } return t.Implements(errorType) } -- GitLab