diff --git a/_examples/golang-imports/api.gen.go b/_examples/golang-imports/api.gen.go index c11695d..bae798a 100644 --- a/_examples/golang-imports/api.gen.go +++ b/_examples/golang-imports/api.gen.go @@ -193,14 +193,14 @@ func (s *exampleAPIServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch contentType { case "application/json": if s.OnRequest != nil { - if err := s.OnRequest(w, r); err != nil { - rpcErr, ok := err.(WebRPCError) - if !ok { - rpcErr = ErrWebrpcEndpoint.WithCause(err) - } - s.sendErrorJSON(w, r, rpcErr) - return - } + if err := s.OnRequest(w, r); err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } } handler(ctx, w, r) diff --git a/server.go.tmpl b/server.go.tmpl index fba3aa2..5c0a77a 100644 --- a/server.go.tmpl +++ b/server.go.tmpl @@ -72,14 +72,14 @@ func (s *{{$serviceName}}) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch contentType { case "application/json": if s.OnRequest != nil { - if err := s.OnRequest(w, r); err != nil { - rpcErr, ok := err.(WebRPCError) - if !ok { - rpcErr = ErrWebrpcEndpoint.WithCause(err) - } - s.sendErrorJSON(w, r, rpcErr) - return - } + if err := s.OnRequest(w, r); err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } } handler(ctx, w, r)