class Desk::Response::ErrorHandling
Constants
- ERROR_TYPE
Public Instance Methods
call(env)
click to toggle source
# File lib/desk/response/error_handling.rb, line 21 def call(env) @app.call(env).on_complete do |finished_env| if finished_env[:status] >= 400 raise ERROR_TYPE[finished_env[:status]], finished_env[:body]["message"] if ERROR_TYPE[finished_env[:status]] end end end