Sha256: e6b29be309781cf58a80d5995367023afedbadee9c4f8b0db35b50d9567aa9d1

Contents?: true

Size: 444 Bytes

Versions: 5

Compression:

Stored size: 444 Bytes

Contents

module Foreman

  class WrappedException < ::Foreman::Exception
    def initialize exception, message, *params
      super(message, *params)
      @exception = exception
    end

    def wrapped_exception
      @exception
    end

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

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/lib/foreman/wrapped_exception.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/lib/foreman/wrapped_exception.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/lib/foreman/wrapped_exception.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/lib/foreman/wrapped_exception.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/lib/foreman/wrapped_exception.rb