Sha256: 788f40c2b21d1d7aa1b82f169e5c4ce011cd8ba2102f98a8c1cff2a6e9d1b993

Contents?: true

Size: 282 Bytes

Versions: 10

Compression:

Stored size: 282 Bytes

Contents

require "cp8_cli/trello/error"

module Cp8Cli
  module Trello
    class ErrorHandler < Faraday::Middleware
      def call(env)
        @app.call(env).on_complete do
          if !env.success?
            raise Error, env[:body]
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cp8_cli-6.0.1 lib/cp8_cli/trello/error_handler.rb
cp8_cli-6.0.0 lib/cp8_cli/trello/error_handler.rb
cp8_cli-5.0.0 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.2.1 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.2.0 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.1.3 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.1.2 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.1.1 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.1.0 lib/cp8_cli/trello/error_handler.rb
cp8_cli-4.0.1 lib/cp8_cli/trello/error_handler.rb