You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class API < Grape::API
format :json
helpers do
def server_error!
error!({ error: 'Server error.' }, 500, { 'Content-Type' => 'text/error' })
end
end
rescue_from :all do |e|
server_error!
end
get :test do
fail 'test'
end
end
Started GET "/api/test" for 127.0.0.1 at 2016-02-23 13:01:51 +0600
NoMethodError (undefined method `server_error!' for #<Grape::Middleware::Error:0x007fcf830dbb28>):
app/api/api.rb:13:in `block in <class:API>'
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: