Parent

Methods

Class/Module Index [+]

Quicksearch

Backup::Errors::Error

Public Class Methods

new(msg = nil, orig_err = nil) click to toggle source
# File lib/backup/errors.rb, line 65
def initialize(msg = nil, orig_err = nil)
  super(msg)
  set_backtrace(orig_err.backtrace) if @orig_err = orig_err
end
wrap(orig_err, msg = nil) click to toggle source
# File lib/backup/errors.rb, line 61
def self.wrap(orig_err, msg = nil)
  new(msg, orig_err)
end

Public Instance Methods

to_s() click to toggle source
# File lib/backup/errors.rb, line 70
def to_s
  return @to_s if @to_s
  orig_to_s = super()

  if orig_to_s == self.class.to_s
    msg = orig_err_msg ?
        "#{orig_err_class}: #{orig_err_msg}" : orig_err_class
  else
    msg = format_msg(orig_to_s)
    msg << "\n  Reason: #{orig_err_class}" + (orig_err_msg ?
        "\n  #{orig_err_msg}" : ' (no message given)') if @orig_err
  end

  @to_s = msg ? msg_prefix + msg : class_name
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.