Sha256: 34f45315d6f144989fb247d5ab3184d180207975df3a4dd7bd132ab3cfded12b

Contents?: true

Size: 653 Bytes

Versions: 16

Compression:

Stored size: 653 Bytes

Contents

require_relative 'conflicting_field'
require_relative 'invalid_event_type'

module RDStation
  class ErrorHandler
    class BadRequest
      BAD_REQUEST_ERRORS = [
        ErrorHandler::ConflictingField,
        ErrorHandler::InvalidEventType,
      ].freeze

      def initialize(array_of_errors)
        @array_of_errors = array_of_errors
      end

      def raise_error
        error_classes.each(&:raise_error)
        raise RDStation::Error::BadRequest, @array_of_errors.first
      end

      private

      def error_classes
        BAD_REQUEST_ERRORS.map do |error|
          error.new(@array_of_errors)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.9.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.8.2 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.8.1 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.8.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.7.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.6.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.5.3 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.5.2 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.5.1 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.5.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.4.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.3.1 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.3.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.2.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.1.0 lib/rdstation/error_handler/bad_request.rb
rdstation-ruby-client-2.0.0 lib/rdstation/error_handler/bad_request.rb