Sha256: 87f980f67dfa9f4990a3512438ca5ed244fd8142dd3ad8519600d235117edadd

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

require 'errawr'

require 'errawr/http/version'

module Errawr
  module HTTP
    I18n.load_path << "#{File.dirname(__FILE__)}/http/locale/en.yml"
    I18n.reload!
    
    ERRORS_4XX = [
      :bad_request,
      :unauthorized,
      :payment_required,
      :forbidden,
      :not_found,
      :method_not_allowed,
      :not_acceptable,
      :proxy_authentication_required,
      :request_timeout,
      :conflict,
      :gone,
      :length_required,
      :precondition_failed,
      :request_entity_too_large,
      :request_uri_too_long,
      :unsupported_media_type,
      :requested_range_not_satisfiable,
      :expectation_failed,
      :unprocessable_entity,
      :locked,
      :failed_dependency,
      :upgrade_required,
      :precondition_required,
      :too_many_requests,
      :request_header_fields_too_large
    ]

    ERRORS_5XX = [
      :internal_server_error,
      :not_implemented,
      :bad_gateway,
      :service_unavailable,
      :gateway_timeout,
      :http_version_not_supported,
      :variant_also_negotiates,
      :insufficient_storage,
      :loop_detected,
      :not_extended,
      :network_authentication_required
    ]

    ERRORS_4XX.each do |e|
      Errawr.register!(e)
    end
    
    ERRORS_5XX.each do |e|
      Errawr.register!(e)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
errawr-http-1.0.1 lib/errawr/http.rb