Exception: ActivityPub::Hooks::FailedHook

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



20
21
22
23
24
25
# File 'lib/activity_pub/hooks.rb', line 20

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.



18
19
20
# File 'lib/activity_pub/hooks.rb', line 18

def hook_name
  @hook_name
end

#hook_source_locationObject

Returns the value of attribute hook_source_location.



18
19
20
# File 'lib/activity_pub/hooks.rb', line 18

def hook_source_location
  @hook_source_location
end

#wrapped_exceptionObject

Returns the value of attribute wrapped_exception.



18
19
20
# File 'lib/activity_pub/hooks.rb', line 18

def wrapped_exception
  @wrapped_exception
end

Instance Method Details

#causeObject



27
28
29
# File 'lib/activity_pub/hooks.rb', line 27

def cause
  wrapped_exception || super
end