@@ -63,7 +63,7 @@ class {{.ControllerName}}Controller < ActionController::Base
6363 rescue_from GRPC::BadStatus do |e|
6464 render json: GrpcRest.error_msg(e), status: GrpcRest.grpc_http_status(e.code)
6565 end
66- rescue_from Google::Protobuf::TypeError do |e|
66+ rescue_from ActionDispatch::Http::Parameters::ParseError, Google::Protobuf::TypeError do |e|
6767 render json: GrpcRest.error_msg(e), status: :bad_request
6868 end
6969 METHOD_PARAM_MAP = {
@@ -102,20 +102,22 @@ func ProcessService(service *descriptorpb.ServiceDescriptorProto, pkg string) (F
102102 return FileResult {}, routes , err
103103 }
104104 restOpts , err := ExtractRestOptions (m )
105- if err != nil { return FileResult {}, routes , err }
105+ if err != nil {
106+ return FileResult {}, routes , err
107+ }
106108 httpMethod , path , err := MethodAndPath (opts .Pattern )
107109 pathInfo , err := ParsedPath (path )
108110 if err != nil {
109111 return FileResult {}, routes , err
110112 }
111113 controllerMethod := method {
112- Name : strcase .ToSnake (m .GetName ()),
113- RequestType : Classify (m .GetInputType ()),
114- Path : path ,
115- RestOptions : rubyRestOptions (restOpts ),
116- HttpMethod : httpMethod ,
117- Body : opts .Body ,
118- PathInfo : pathInfo ,
114+ Name : strcase .ToSnake (m .GetName ()),
115+ RequestType : Classify (m .GetInputType ()),
116+ Path : path ,
117+ RestOptions : rubyRestOptions (restOpts ),
118+ HttpMethod : httpMethod ,
119+ Body : opts .Body ,
120+ PathInfo : pathInfo ,
119121 }
120122 data .Methods = append (data .Methods , controllerMethod )
121123 routes = append (routes , Route {
0 commit comments