Module: ABRT::Exception

Defined in:
lib/abrt/exception.rb

Instance Method Summary collapse

Instance Method Details

#executableObject

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



15
16
17
# File 'lib/abrt/exception.rb', line 15

def executable
  backtrace && backtrace.last && backtrace.last[/(.*?):/, 1] || $PROGRAM_NAME
end

#formatObject

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



7
8
9
10
11
# 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