lib/roda/plugins/typecast_params.rb
# Handle any conversion errors.  By default, reraises Error instances with the keys set,
# converts ::ArgumentError instances to Error instances, and reraises other exceptions.
Handle any conversion errors.  By default, reraises Error instances with the keys set,
converts ::ArgumentError instances to Error instances, and reraises other exceptions.
Handle any conversion errors . By default reraises Error instances with the keys set converts :: ArgumentError instances to Error instances and reraises other exceptions .
def handle_error(key, reason, e, do_raise=false)
          case e
          when String
            handle_error(key, reason, Error.new(e), do_raise)
          when Error, ArgumentError
            if @capture && (le = @capture.last) && le == e
              raise e if do_raise
              return
            end
            e = Error.create(keys(key), reason, e)
            if @capture
              @capture << e
              raise e if do_raise
              nil
            else
              raise e
            end
          else
            raise e
          end
        end
def handle_error ( key , reason , e , do_raise = false ) case e when String handle_error ( key , reason , Error . new ( e ) , do_raise ) when Error , ArgumentError if @capture && ( le = @capture . last ) && le == e raise e if do_raise return end e = Error . create ( keys ( key ) , reason , e ) if @capture @capture << e raise e if do_raise nil else raise e end else raise e end end
Handle any conversion errors.
Handle any conversion errors .
key
reason
e
do_raise