Exception: RequestaError::CustomError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/requesta/errors.rb

Direct Known Subclasses

MethodError, RequestError, RequestHeaderError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Default error message", foo = 'bar') ⇒ CustomError

Returns a new instance of CustomError.



12
13
14
15
# File 'lib/requesta/errors.rb', line 12

def initialize(message="Default error message", foo='bar')
  @foo = foo
  super(message)
end

Instance Attribute Details

#fooObject (readonly)

Returns the value of attribute foo.



10
11
12
# File 'lib/requesta/errors.rb', line 10

def foo
  @foo
end

Instance Method Details

#reportObject



17
18
19
20
21
22
23
24
25
# File 'lib/requesta/errors.rb', line 17

def report
  "\n\n" + 
  self.class.to_s + 
  ":\s" + 
  self.message + 
  "\n\n" + 
  self.backtrace.join("\n") + 
  "\n\n"
end