Exception: DiscourseApi::Error

Inherits:
DiscourseError show all
Defined in:
lib/discourse_api/error.rb

Direct Known Subclasses

Timeout

Instance Attribute Summary collapse

Attributes inherited from DiscourseError

#response

Instance Method Summary collapse

Constructor Details

#initialize(exception = $!) ⇒ DiscourseApi::Error

Initializes a new Error object

Parameters:

  • exception (Exception, String) (defaults to: $!)


19
20
21
22
# File 'lib/discourse_api/error.rb', line 19

def initialize(exception = $!)
  @wrapped_exception = exception
  exception.respond_to?(:message) ? super(exception.message) : super(exception.to_s)
end

Instance Attribute Details

#wrapped_exceptionObject (readonly)

Returns the value of attribute wrapped_exception.



13
14
15
# File 'lib/discourse_api/error.rb', line 13

def wrapped_exception
  @wrapped_exception
end