Class: ActionDispatch::ParamsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/request_exception_handler.rb,
lib/request_exception_handler.rb

Overview

Rails 3.x

Instance Method Summary collapse

Instance Method Details

#parse_formatted_parametersObject Also known as: parse_formatted_parameters_without_exception_handler



128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/request_exception_handler.rb', line 128

def parse_formatted_parameters_with_exception_handler(env)
  begin
    out = parse_formatted_parameters_without_exception_handler(env)
    RequestExceptionHandler.reset_request_exception # make sure it's nil
    out
  rescue ParseError => e
    e = e.original_exception
    handler = RequestExceptionHandler.parse_request_parameters_exception_handler
    handler ? handler.call(ActionDispatch::Request.new(env), e) : raise
  rescue => e # all Exception-s get wrapped into ParseError ... but just in case
    handler = RequestExceptionHandler.parse_request_parameters_exception_handler
    handler ? handler.call(ActionDispatch::Request.new(env), e) : raise
  end
end

#parse_formatted_parameters_with_exception_handler(env) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/request_exception_handler.rb', line 113

def parse_formatted_parameters_with_exception_handler(env)
  begin
    out = parse_formatted_parameters_without_exception_handler(env)
    RequestExceptionHandler.reset_request_exception # make sure it's nil
    out
  rescue ParseError => e
    e = e.original_exception
    handler = RequestExceptionHandler.parse_request_parameters_exception_handler
    handler ? handler.call(ActionDispatch::Request.new(env), e) : raise
  rescue => e # all Exception-s get wrapped into ParseError ... but just in case
    handler = RequestExceptionHandler.parse_request_parameters_exception_handler
    handler ? handler.call(ActionDispatch::Request.new(env), e) : raise
  end
end