Exception: SocialWeb::Hooks::FailedHook

Inherits:
Error
  • Object
show all
Defined in:
lib/social_web/hooks.rb

Constant Summary collapse

MESSAGE_FORMAT =
"%<hook_name>s: %<hook_source_location>s\n\n%<exception_class>s: %<exception_message>s\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hook_name, hook_source_location, wrapped_exception) ⇒ FailedHook

Returns a new instance of FailedHook.



13
14
15
16
17
18
# File 'lib/social_web/hooks.rb', line 13

def initialize(hook_name, hook_source_location, wrapped_exception)
  @hook_name = hook_name
  @hook_source_location = hook_source_location
  @wrapped_exception = wrapped_exception
  super(format_message)
end

Instance Attribute Details

#hook_nameObject

Returns the value of attribute hook_name.



11
12
13
# File 'lib/social_web/hooks.rb', line 11

def hook_name
  @hook_name
end

#hook_source_locationObject

Returns the value of attribute hook_source_location.



11
12
13
# File 'lib/social_web/hooks.rb', line 11

def hook_source_location
  @hook_source_location
end

#wrapped_exceptionObject

Returns the value of attribute wrapped_exception.



11
12
13
# File 'lib/social_web/hooks.rb', line 11

def wrapped_exception
  @wrapped_exception
end

Instance Method Details

#causeObject



20
21
22
# File 'lib/social_web/hooks.rb', line 20

def cause
  wrapped_exception || super
end