Sha256: 38ebbe282aafa8a10cd64eda0ecfd9e1d6a148af6510ad799990b603a87f90d7

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

module Dolly
  class ResourceNotFound < RuntimeError
    def to_s
      'The document was not found.'
    end
  end

  class ServerError < RuntimeError
    def initialize msg
      @msg = msg
    end

    def to_s
      "There has been an error on the couchdb server: #{@msg.inspect}"
    end
  end

  class InvalidMangoOperatorError < RuntimeError
    def initialize msg
      @msg = msg
    end

    def to_s
      "Invalid Mango operator: #{@msg.inspect}"
    end
  end

  class BulkError < RuntimeError
    def intialize(error:, reason:, obj:)
      @error = error
      @reason = reason
      @obj = obj
    end

    def to_s
      "#{@error} on #{@obj} because #{@reason}."
    end
  end

  class MissingSlugableProperties < RuntimeError
    def initialize(properties)
      @properties = properties.join(', ')
    end

    def to_s
      "Missing slugable: #{@properties}."
    end
  end

  class PartitionedDataBaseExpectedError < RuntimeError; end
  class IndexNotFoundError < RuntimeError; end
  class InvalidConfigFileError < RuntimeError; end
  class InvalidProperty < RuntimeError; end
  class DocumentInvalidError < RuntimeError; end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dolly-3.1.5 lib/dolly/exceptions.rb
dolly-3.1.4 lib/dolly/exceptions.rb
dolly-3.1.3 lib/dolly/exceptions.rb