class Saddle::Middleware::Response::DefaultResponse
Public: Returns a default response in the case of an exception Expects default_response to be defined in the request of connection options, otherwise rethrows exception
Public Instance Methods
call(env)
click to toggle source
# File lib/saddle/middleware/response/default_response.rb, line 12 def call(env) begin @app.call(env) rescue if res = env[:saddle][:default_response] return ::Faraday::Response.new(:body => res) else raise end end end