Exception: WellKnown::Hooks::FailedHook

Inherits:
Error
  • Object
show all
Defined in:
lib/well_known/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.



18
19
20
21
22
23
# File 'lib/well_known/hooks.rb', line 18

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.



16
17
18
# File 'lib/well_known/hooks.rb', line 16

def hook_name
  @hook_name
end

#hook_source_locationObject

Returns the value of attribute hook_source_location.



16
17
18
# File 'lib/well_known/hooks.rb', line 16

def hook_source_location
  @hook_source_location
end

#wrapped_exceptionObject

Returns the value of attribute wrapped_exception.



16
17
18
# File 'lib/well_known/hooks.rb', line 16

def wrapped_exception
  @wrapped_exception
end

Instance Method Details

#causeObject



25
26
27
# File 'lib/well_known/hooks.rb', line 25

def cause
  wrapped_exception || super
end