module ABRT::Exception

Public Instance Methods

executable() click to toggle source

Obtains executable name from backtrace. This should be more reliable then use of $0 aka $PROGRAM_NAME.

# File lib/abrt/exception.rb, line 15
def executable
  backtrace && backtrace.last && backtrace.last[/(.*?):/, 1] || $PROGRAM_NAME
end
format() click to toggle source

Provides the exception formated in the same way as Ruby does for standard error output.

# File lib/abrt/exception.rb, line 7
def format
  backtrace = self.backtrace.collect { |line| "\tfrom #{line}" }
  backtrace[0] = "#{self.backtrace.first}: #{self.message} (#{self.class.name})"
  backtrace
end