Sha256: a45fcca381f755282f78b05a357f0a5707ded1ebd87726684009ecdb8b7372f7

Contents?: true

Size: 1.42 KB

Versions: 23

Compression:

Stored size: 1.42 KB

Contents

module Lapse
  # Standard Lapse error
  class Error < StandardError; end

  # Raised when Lapse returns a 400 HTTP status code
  class BadRequest < Error; end

  # Raised when Lapse returns a 401 HTTP status code
  class Unauthorized < Error; end

  # Raised when Lapse returns a 403 HTTP status code
  class Forbidden < Error; end

  # Raised when Lapse returns a 404 HTTP status code
  class NotFound < Error; end

  # Raised when Lapse returns a 406 HTTP status code
  class NotAcceptable < Error; end

  # Raised when Lapse returns a 422 HTTP status code
  class UnprocessableEntity < Error; end

  # Raised when Lapse returns a 500 HTTP status code
  class InternalServerError < Error; end

  # Raised when Lapse returns a 501 HTTP status code
  class NotImplemented < Error; end

  # Raised when Lapse returns a 502 HTTP status code
  class BadGateway < Error; end

  # Raised when Lapse returns a 503 HTTP status code
  class ServiceUnavailable < Error; end

  # Raised when a unique ID is required but not provided
  class UniqueIDRequired < Error; end

  # Status code to exception map
  ERROR_MAP = {
    400 => Lapse::BadRequest,
    401 => Lapse::Unauthorized,
    403 => Lapse::Forbidden,
    404 => Lapse::NotFound,
    406 => Lapse::NotAcceptable,
    422 => Lapse::UnprocessableEntity,
    500 => Lapse::InternalServerError,
    501 => Lapse::NotImplemented,
    502 => Lapse::BadGateway,
    503 => Lapse::ServiceUnavailable
  }
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
lapse-0.1.0 lib/lapse/error.rb
lapse-0.0.23 lib/lapse/error.rb
lapse-0.0.22 lib/lapse/error.rb
lapse-0.0.21 lib/lapse/error.rb
lapse-0.0.20 lib/lapse/error.rb
lapse-0.0.19 lib/lapse/error.rb
lapse-0.0.18 lib/lapse/error.rb
lapse-0.0.17 lib/lapse/error.rb
lapse-0.0.16 lib/lapse/error.rb
lapse-0.0.15 lib/lapse/error.rb
lapse-0.0.14 lib/lapse/error.rb
lapse-0.0.13 lib/lapse/error.rb
lapse-0.0.12 lib/lapse/error.rb
lapse-0.0.11 lib/lapse/error.rb
lapse-0.0.10 lib/lapse/error.rb
lapse-0.0.9 lib/lapse/error.rb
lapse-0.0.8 lib/lapse/error.rb
lapse-0.0.7 lib/lapse/error.rb
lapse-0.0.6 lib/lapse/error.rb
lapse-0.0.5 lib/lapse/error.rb