Exception: Acapela::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/acapela/error.rb

Direct Known Subclasses

ServiceError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, original_error = nil) ⇒ Error

Returns a new instance of Error.



6
7
8
9
# File 'lib/acapela/error.rb', line 6

def initialize(message, original_error = nil)
  super(message)
  @original_error = original_error
end

Instance Attribute Details

#original_errorObject

Returns the value of attribute original_error.



4
5
6
# File 'lib/acapela/error.rb', line 4

def original_error
  @original_error
end

Instance Method Details

#to_sObject



11
12
13
14
15
16
17
# File 'lib/acapela/error.rb', line 11

def to_s
  if @original_error.nil?
    super
  else
    "#{super}\nCause: #{@original_error.to_s}"
  end
end