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

Inherits:
FileSystemError
  • Object
show all
Defined in:
lib/chef/chef_fs/file_system/exceptions.rb

Direct Known Subclasses

AlreadyExistsError

Instance Attribute Summary collapse

Attributes inherited from FileSystemError

#cause, #entry, #reason

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OperationFailedError.



48
49
50
51
# File 'lib/chef/chef_fs/file_system/exceptions.rb', line 48

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

Instance Attribute Details

#operationObject (readonly)

Returns the value of attribute operation.



61
62
63
# File 'lib/chef/chef_fs/file_system/exceptions.rb', line 61

def operation
  @operation
end

Instance Method Details

#messageObject



53
54
55
56
57
58
59
# File 'lib/chef/chef_fs/file_system/exceptions.rb', line 53

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