File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed
main/ruby/rack/handler/servlet Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,6 @@ def load_env_key(env, key)
5151 # @private
5252 POST_PARAM_METHODS = [ 'POST' , 'PUT' , 'DELETE' ] . freeze
5353
54- if defined? Rack ::Utils ::ParameterTypeError
55- ParameterTypeError = Rack ::Utils ::ParameterTypeError
56- else
57- ParameterTypeError = TypeError
58- end
59-
6054 # Load parameters into the (Rack) env from the Servlet API.
6155 # using javax.servlet.http.HttpServletRequest#getParameterMap
6256 def load_parameters
@@ -188,8 +182,8 @@ def parse_query_string
188182 end
189183
190184 def mark_parameter_error ( msg )
191- raise ParameterTypeError , msg
192- rescue ParameterTypeError => e
185+ raise Rack :: Utils :: ParameterTypeError , msg
186+ rescue Rack :: Utils :: ParameterTypeError => e
193187 @parameter_error = e
194188 end
195189
Original file line number Diff line number Diff line change @@ -473,16 +473,9 @@ def getAttributeNames
473473 env = servlet . create_env ( @servlet_env )
474474 rack_request = Rack ::Request . new ( env )
475475
476- # Rack::Utils::ParameterTypeError (< TypeError) since 1.6.0
477- if Rack ::Utils . const_defined? :ParameterTypeError
478- error = Rack ::Utils ::ParameterTypeError
479- else
480- error = TypeError
481- end
482-
483- expect { rack_request . GET } . to raise_error ( error , "expected Hash (got Array) for param `foo'" )
476+ expect { rack_request . GET } . to raise_error ( Rack ::Utils ::ParameterTypeError , "expected Hash (got Array) for param `foo'" )
484477 expect ( rack_request . POST ) . to eq ( { } )
485- expect { rack_request . params } . to raise_error ( error , "expected Hash (got Array) for param `foo'" )
478+ expect { rack_request . params } . to raise_error ( Rack :: Utils :: ParameterTypeError , "expected Hash (got Array) for param `foo'" )
486479
487480 expect ( rack_request . query_string ) . to eq 'foo[]=0&foo[bar]=1'
488481 end
You can’t perform that action at this time.
0 commit comments