Sha256: 625cd4a8f012d189fb49b3e03b985eb1cfbfb9803c23eb09aec78ead215cb749

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

require_relative "./error_base"

module HTTPError

  # 500 Internal Server Error
  class InternalServerError < ErrorBase
    CODE = Rack::Utils.status_code(:internal_server_error)
  end

  # 501 Not Implemented
  class NotImplemented < ErrorBase
    CODE = Rack::Utils.status_code(:not_implemented)
  end

  # 502 Bad Gateway
  class BadGateway < ErrorBase
    CODE = Rack::Utils.status_code(:bad_gateway)
  end

  # 503 Service Unavailable
  class ServiceUnavailable < ErrorBase
    CODE = Rack::Utils.status_code(:service_unavailable)
  end

  # 504 Gateway Timeout
  class GatewayTimeout < ErrorBase
    CODE = Rack::Utils.status_code(:gateway_timeout)
  end

  # 505 HTTP Version Not Supported
  class HTTPVersionNotSupported < ErrorBase
    CODE = Rack::Utils.status_code(:http_version_not_supported)
  end

  # 506 Variant Also Negotiates
  class VariantAlsoNegotiates < ErrorBase
    CODE = Rack::Utils.status_code(:variant_also_negotiates)
  end

  # 507 Insufficient Storage
  class InsufficientStorage < ErrorBase
    CODE = Rack::Utils.status_code(:insufficient_storage)
  end

  # 508 Loop Detected
  class LoopDetected < ErrorBase
    CODE = Rack::Utils.status_code(:loop_detected)
  end

  # 510 Not Extended
  class NotExtended < ErrorBase
    CODE = Rack::Utils.status_code(:not_extended)
  end

  # 511 Network Authentication Required
  class NetworkAuthenticationRequired < ErrorBase
    CODE = Rack::Utils.status_code(:network_authentication_required)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sinatra-errorcodes-0.4.2 lib/5xx_errors.rb
sinatra-errorcodes-0.4.1 lib/5xx_errors.rb
sinatra-errorcodes-0.3.1 lib/5xx_errors.rb
sinatra-errorcodes-0.2.1 lib/5xx_errors.rb