Exception: Adama::Errors::BaseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/adama/errors.rb

Direct Known Subclasses

CommandError, InvokerError, InvokerRollbackError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error:, command:, invoker: nil, backtrace: nil) ⇒ BaseError

Returns a new instance of BaseError.



6
7
8
9
10
11
# File 'lib/adama/errors.rb', line 6

def initialize(error:, command:, invoker: nil, backtrace: nil)
  @error = error
  @command = command
  @invoker = invoker
  set_backtrace backtrace if backtrace
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



4
5
6
# File 'lib/adama/errors.rb', line 4

def command
  @command
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/adama/errors.rb', line 4

def error
  @error
end

#invokerObject (readonly)

Returns the value of attribute invoker.



4
5
6
# File 'lib/adama/errors.rb', line 4

def invoker
  @invoker
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/adama/errors.rb', line 13

def to_s
  "#{command.class.name} failed with #{error.class}: #{error.message}"
end