class Autobuild::PhaseException

Base class for all Autobuild exceptions

Attributes

phase[RW]
target[RW]

Public Class Methods

new(target = nil, phase = nil, options = Hash.new) click to toggle source
Creates a new exception which occured while doing *phase*

in target

Calls superclass method
# File lib/autobuild/exceptions.rb, line 22
def initialize(target = nil, phase = nil, options = Hash.new)
    options = Kernel.validate_options options, retry: true
    @target = target
    @phase  = phase
    @retry  = options[:retry]
    super()
end

Public Instance Methods

exception_message()
Alias for: to_s
fatal?() click to toggle source

If the error is fatal

# File lib/autobuild/exceptions.rb, line 10
def fatal?
    true
end
mail?() click to toggle source

If the error should be reported by mail

# File lib/autobuild/exceptions.rb, line 5
def mail?
    false
end
retry?() click to toggle source

If the error can be retried

# File lib/autobuild/exceptions.rb, line 15
def retry?
    @retry
end
to_s() click to toggle source
Calls superclass method
# File lib/autobuild/exceptions.rb, line 31
def to_s
    dir = "(#{target.srcdir})" if target.respond_to?(:srcdir)
    target_name =
        if target.respond_to?(:name)
            target.name
        else target.to_str
        end

    if target && phase
        "#{target_name}#{dir}: failed in #{phase} phase\n    #{super}"
    elsif target
        "#{target_name}#{dir}: #{super}"
    else
        super
    end
end
Also aliased as: exception_message