Sha256: a75037e23c702d6df3efd9e3cb98759244dfca905a55963ec343d765e6656947

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module RequestHandler
  class BaseError < StandardError
    attr_reader :errors
    def initialize(errors)
      @errors = errors
      super(message)
    end

    def message
      errors.map do |key, value|
        "#{key}: #{value}"
      end.join(', ')
    end
  end
  class InternalBaseError < BaseError
  end
  class ExternalBaseError < BaseError
  end
  class MissingArgumentError < InternalBaseError
  end
  class ExternalArgumentError < ExternalBaseError
  end
  class InternalArgumentError < InternalBaseError
  end
  class SchemaValidationError < ExternalBaseError
  end
  class OptionNotAllowedError < ExternalBaseError
  end
  class NoConfigAvailableError < InternalBaseError
  end

  class BodyParamsError < ExternalArgumentError
  end
  class FieldsetsParamsError < ExternalArgumentError
  end
  class FilterParamsError < ExternalArgumentError
  end
  class IncludeParamsError < ExternalArgumentError
  end
  class PageParamsError < ExternalArgumentError
  end
  class SortParamsError < ExternalArgumentError
  end
  class MultipartParamsError < ExternalArgumentError
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
request_handler-1.2.0 lib/request_handler/error.rb
request_handler-1.1.0 lib/request_handler/error.rb
request_handler-1.0.0 lib/request_handler/error.rb
request_handler-0.15.0 lib/request_handler/error.rb
request_handler-0.14.0 lib/request_handler/error.rb
request_handler-0.13.0 lib/request_handler/error.rb
request_handler-0.12.0 lib/request_handler/error.rb