Exception: Foreman::WrappedException

Inherits:
Exception
  • Object
show all
Defined in:
lib/foreman/wrapped_exception.rb

Instance Method Summary collapse

Methods inherited from Exception

calculate_error_code, #code, #message_untranslated

Constructor Details

#initialize(exception, message, *params) ⇒ WrappedException


4
5
6
7
# File 'lib/foreman/wrapped_exception.rb', line 4

def initialize exception, message, *params
  super(message, *params)
  @exception = exception
end

Instance Method Details

#messageObject


13
14
15
16
17
18
19
20
# File 'lib/foreman/wrapped_exception.rb', line 13

def message
  if @exception.nil?
    wrapped = ""
  else
    wrapped = " (#{@exception.class.name} - #{@exception.message})"
  end
  "#{code}: #{@message}#{wrapped}"
end

#wrapped_exceptionObject


9
10
11
# File 'lib/foreman/wrapped_exception.rb', line 9

def wrapped_exception
  @exception
end