Exception: DevCycle::AfterHookError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb

Overview

Custom error raised when an after hook fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, original_error = nil, hook_context = nil) ⇒ AfterHookError



26
27
28
29
30
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 26

def initialize(message = nil, original_error = nil, hook_context = nil)
  super(message || "After hook execution failed")
  @original_error = original_error
  @hook_context = hook_context
end

Instance Attribute Details

#hook_contextObject (readonly)

Returns the value of attribute hook_context.



24
25
26
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 24

def hook_context
  @hook_context
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



24
25
26
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 24

def original_error
  @original_error
end

Instance Method Details

#to_sObject



32
33
34
35
36
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 32

def to_s
  msg = super
  msg += "\nOriginal error: #{@original_error.message}" if @original_error
  msg
end