class Subordinate::Connection::ErrorMiddleware
Middleware for responding to Errors returned from the api
Public Class Methods
new(app)
click to toggle source
# File lib/subordinate/connection.rb, line 28 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/subordinate/connection.rb, line 32 def call(env) @app.call(env).on_complete do |env| if error = Subordinate::Error.from(env[:response]) raise error end end end