Я пишу requires
вот так
params do
requires :user_id, :type => Integer
optional :page, :type => Integer, :default => 1
optional :per_page, :type => Integer, :default => 20
end
и я написал rescue_from
rescue_from :all do |e|
case e
when Grape::Exceptions::ValidationErrors
error!({ messages: e.full_messages }, 400)
else
Rails.logger.error "Api Error: #{e}"
Rails.logger.error "#{e.backtrace.join("\n")}"
error!({ messages: "errors" }, 500)
end
end
но я не могу поймать Grape::Exceptions::ValidationErrors
без params[:user_id]
but it doesn't works for Grape::Exceptions::ValidationErrors
? Что вы ожидаете ? - person chumakoff   schedule 18.08.2015