Exception: DevCycle::BeforeHookError

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

Overview

Custom error raised when a before hook fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of BeforeHookError.



9
10
11
12
13
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 9

def initialize(message = nil, original_error = nil, hook_context = nil)
  super(message || "Before 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.



7
8
9
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 7

def hook_context
  @hook_context
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



7
8
9
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 7

def original_error
  @original_error
end

Instance Method Details

#to_sObject



15
16
17
18
19
# File 'lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb', line 15

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