class Autobuild::SubcommandFailed
An error occured while running a subcommand
Attributes
Public Class Methods
Source
# File lib/autobuild/exceptions.rb, line 92 def initialize(*args) case args.size when 1 sc = args[0] target = sc.target command = sc.command logfile = sc.logfile status = sc.status output = sc.output @orig_message = sc.exception_message when 4, 5 target, command, logfile, status, output = *args else raise ArgumentError, "wrong number of arguments, should be 1 or 4..5" end super(target) @command = command @logfile = logfile @status = status @output = output || Array.new end
Calls superclass method
Autobuild::PhaseException::new
Public Instance Methods
Source
# File lib/autobuild/exceptions.rb, line 115 def to_s msg = super msg << "\n #{@orig_message}" if @orig_message msg << "\n see #{logfile} for details" # If we do not have a status, it means an error occured in the # launching process. More importantly, it means we already have a # proper explanation for it. Don't display the logfile at all. if status lines = @output logsize = Autobuild.displayed_error_line_count if logsize != Float::INFINITY && lines.size > logsize lines = lines[-logsize, logsize] end msg << "\n last #{lines.size} lines are:\n\n" lines.each do |l| msg << " #{l}\n" end end msg end
Calls superclass method
Autobuild::PhaseException#to_s