Sha256: 91a649fcf2bacb5d6942c3b99134560584f370a6262b1ae306c9460c8817e272

Contents?: true

Size: 1.6 KB

Versions: 6

Compression:

Stored size: 1.6 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 Rosemary is instantiated without a client
  class CredentialsMissing < StandardError; end

  # This error occurs when Rosemary has no changeset.
  class ChangesetMissing < 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

  # 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

  class Unavailable < Error; end # 503

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

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rosemary-0.2.7 lib/rosemary/errors.rb
rosemary-0.2.6 lib/rosemary/errors.rb
rosemary-0.2.5 lib/rosemary/errors.rb
rosemary-0.2.4 lib/rosemary/errors.rb
rosemary-0.2.3 lib/rosemary/errors.rb
rosemary-0.2.2 lib/rosemary/errors.rb