Exception: Hbc::CaskCommandFailedError

Inherits:
CaskError
  • Object
show all
Defined in:
Library/Homebrew/cask/lib/hbc/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(cmd, stdout, stderr, status) ⇒ CaskCommandFailedError

Returns a new instance of CaskCommandFailedError



57
58
59
60
61
62
# File 'Library/Homebrew/cask/lib/hbc/exceptions.rb', line 57

def initialize(cmd, stdout, stderr, status)
  @cmd = cmd
  @stdout = stdout
  @stderr = stderr
  @status = status
end

Instance Method Details

#to_sObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'Library/Homebrew/cask/lib/hbc/exceptions.rb', line 64

def to_s
  s = "Command failed to execute!\n"
  s.concat("\n")
  s.concat("==> Failed command:\n")
  s.concat(@cmd.join(" ")).concat("\n")
  s.concat("\n")
  s.concat("==> Standard Output of failed command:\n")
  s.concat(@stdout).concat("\n")
  s.concat("\n")
  s.concat("==> Standard Error of failed command:\n")
  s.concat(@stderr).concat("\n")
  s.concat("\n")
  s.concat("==> Exit status of failed command:\n")
  s.concat(@status.inspect).concat("\n")
end