Sha256: 5a857b99590cea58e9ff9e2951dea478bc421e7862c5500e025cd5e68a7216c0

Contents?: true

Size: 1.78 KB

Versions: 13

Compression:

Stored size: 1.78 KB

Contents

module Rosemary
  # Unspecified OSM API error.
  class Error < StandardError
    attr_reader :data

    def initialize(data)
      @data = data
      super
    end
  end

  # This error occurs when the request send to the server could not be parsed.
  class ParseError < StandardError; end

  # This error occurs when Rosemary is instantiated without a client
  class CredentialsMissing < StandardError; end

  # An object was not found in the database.
  class NotFound < Error; end

  # The API returned HTTP 400 (Bad Request).
  class BadRequest < Error; end # 400

  # The API operation wasn't authorized. This happens if you didn't set the user and
  # password for a write operation.
  class Unauthorized < Error; end # 401

  # You don't have sufficient permissions to make that request.
  class Forbidden < Error; end # 403

  # The object was not found (HTTP 404). Generally means that the object doesn't exist
  # and never has.
  class NotFound < Error; end # 404

  # If the request is not a HTTP PUT request
  class MethodNotAllowed < Error; end # 405

  # If the changeset in question has already been closed
  class Conflict < Error; end # 409

  # The object was not found (HTTP 410), but it used to exist. This generally means
  # that the object existed at some point, but was deleted.
  class Gone < Error; end # 410

  # When a node is still used by a way
  # When a node is still member of a relation
  # When a way is still member of a relation
  # When a relation is still member of another relation
  class Precondition < Error; end # 412

  # Unspecified API server error.
  class ServerError < Error; end # 500

  # When the API service times out or returns an HTTP 503 status.
  class Unavailable < Error; end # 503

  # This method is not implemented yet.
  class NotImplemented < Error; end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rosemary-0.4.4 lib/rosemary/errors.rb
rosemary-0.4.3 lib/rosemary/errors.rb
rosemary-0.4.2 lib/rosemary/errors.rb
rosemary-0.4.1 lib/rosemary/errors.rb
rosemary-0.4.0 lib/rosemary/errors.rb
rosemary-0.3.12 lib/rosemary/errors.rb
rosemary-0.3.11 lib/rosemary/errors.rb
rosemary-0.3.10 lib/rosemary/errors.rb
rosemary-0.3.9 lib/rosemary/errors.rb
rosemary-0.3.8 lib/rosemary/errors.rb
rosemary-0.3.7 lib/rosemary/errors.rb
rosemary-0.3.6 lib/rosemary/errors.rb
rosemary-0.3.5 lib/rosemary/errors.rb