Exception: Couch::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/couch/error.rb,
lib/couch/error.rb

Direct Known Subclasses

Error404

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Error

Returns a new instance of Error.



2
# File 'lib/couch/error.rb', line 2

def initialize(options); @options = options; end

Class Method Details

.ignore(&block) ⇒ Object



7
8
9
10
11
12
# File 'lib/couch/error.rb', line 7

def self.ignore(&block)
  yield
rescue Couch::Error
  dlog.warn $!
  nil
end

.raise(options) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/couch/error.rb', line 19

def self.raise(options)
  case options[:code].to_s
  when "404"
    super Couch::Error404, options
  else
    super Couch::Error, options
  end
end

Instance Method Details

#inspectObject



5
# File 'lib/couch/error.rb', line 5

def inspect; @options.inspect; end

#to_sObject



4
# File 'lib/couch/error.rb', line 4

def to_s; @options.inspect; end