Sha256: 4c9230c95c6d7b0a97cd914d12201ca8ccb587463a76b6d7687412d11fbb46dc

Contents?: true

Size: 433 Bytes

Versions: 21

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

require 'friendly_shipping/services/ship_engine/bad_request'

module FriendlyShipping
  module Services
    class ShipEngine
      class BadRequestHandler
        extend Dry::Monads::Result::Mixin

        def self.call(error)
          if error.http_code == 400
            Failure(BadRequest.new(error))
          else
            Failure(error)
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
friendly_shipping-0.5.3 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.5.2 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.5.1 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.5 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.14 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.13 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.12 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.11 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.10 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.9 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.8 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.7 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.6 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.5 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.4 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.3 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.2 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.1 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.4.0 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb
friendly_shipping-0.3.4 lib/friendly_shipping/services/ship_engine/bad_request_handler.rb