Class: Slack::Web::Faraday::Response::RaiseError

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/slack/web/faraday/response/raise_error.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



6
7
8
9
10
# File 'lib/slack/web/faraday/response/raise_error.rb', line 6

def on_complete(env)
  body = env.body
  return if body['ok']
  fail Slack::Web::Api::Error.new(body['error'], env.response)
end