Sha256: 3595e7db01b816d500fb41d0444926a060f56607c88ce45042414e731fc495e8
Contents?: true
Size: 587 Bytes
Versions: 9
Compression:
Stored size: 587 Bytes
Contents
module Slack module Web module Faraday module Response class RaiseError < ::Faraday::Response::Middleware def on_complete(env) if env.status == 429 raise Slack::Web::Api::Errors::TooManyRequestsError, env.response elsif (body = env.body) && !body['ok'] error_message = body['error'] || body['errors'].map { |message| message['error'] }.join(',') raise Slack::Web::Api::Errors::SlackError.new(error_message, env.response) end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems