Exception: DevCycle::BeforeHookError
- Inherits:
-
StandardError
- Object
- StandardError
- DevCycle::BeforeHookError
- Defined in:
- lib/devcycle-ruby-server-sdk/eval_hooks_runner.rb
Overview
Custom error raised when a before hook fails
Instance Attribute Summary collapse
-
#hook_context ⇒ Object
readonly
Returns the value of attribute hook_context.
-
#original_error ⇒ Object
readonly
Returns the value of attribute original_error.
Instance Method Summary collapse
-
#initialize(message = nil, original_error = nil, hook_context = nil) ⇒ BeforeHookError
constructor
A new instance of BeforeHookError.
- #to_s ⇒ Object
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( = nil, original_error = nil, hook_context = nil) super( || "Before hook execution failed") @original_error = original_error @hook_context = hook_context end |
Instance Attribute Details
#hook_context ⇒ Object (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_error ⇒ Object (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_s ⇒ Object
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 |