From 8b1bd09d9b2a0a98ff5401edee8c43aa4e49449a Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 18 Sep 2014 20:32:50 -0500 Subject: Pass command and arg list into ErrorDuringExecution constructor --- Library/Homebrew/exceptions.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/exceptions.rb') diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index da48d60ca..100effdbd 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -214,7 +214,12 @@ end class CurlDownloadStrategyError < RuntimeError; end # raised by safe_system in utils.rb -class ErrorDuringExecution < RuntimeError; end +class ErrorDuringExecution < RuntimeError + def initialize(cmd, args=[]) + args = args.map { |a| a.to_s.gsub " ", "\\ " }.join(" ") + super "Failure while executing: #{cmd} #{args}" + end +end # raised by Pathname#verify_checksum when "expected" is nil or empty class ChecksumMissingError < ArgumentError; end -- cgit v1.2.3