Exception: Docker::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/docker/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, status, detail) ⇒ Error

Returns a new instance of Error.

Parameters:

  • cmd (String)
  • status (Integer)
  • detail (String)


8
9
10
11
12
13
14
# File 'lib/docker/error.rb', line 8

def initialize(cmd, status, detail)
  @status = status
  @detail = detail
  brief = detail.split("\n").first || '(no output)'
  message = format("'%s' failed with status %d: %s", cmd, status, brief)
  super(message)
end

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail.



3
4
5
# File 'lib/docker/error.rb', line 3

def detail
  @detail
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/docker/error.rb', line 3

def status
  @status
end