Exception: Chef::ChefFS::FileSystem::OperationFailedError

Inherits:
FileSystemError show all
Defined in:
lib/chef/chef_fs/file_system/operation_failed_error.rb

Direct Known Subclasses

AlreadyExistsError

Instance Attribute Summary collapse

Attributes inherited from FileSystemError

#cause, #entry

Instance Method Summary collapse

Constructor Details

#initialize(operation, entry, cause = nil) ⇒ OperationFailedError

Returns a new instance of OperationFailedError.



25
26
27
28
# File 'lib/chef/chef_fs/file_system/operation_failed_error.rb', line 25

def initialize(operation, entry, cause = nil)
  super(entry, cause)
  @operation = operation
end

Instance Attribute Details

#operationObject (readonly)

Returns the value of attribute operation.



38
39
40
# File 'lib/chef/chef_fs/file_system/operation_failed_error.rb', line 38

def operation
  @operation
end

Instance Method Details

#messageObject



30
31
32
33
34
35
36
# File 'lib/chef/chef_fs/file_system/operation_failed_error.rb', line 30

def message
  if cause && cause.is_a?(Net::HTTPExceptions) && cause.response.code == "400"
    "#{super} cause: #{cause.response.body}"
  else
    super
  end
end