Exception: ChefFS::FileSystem::OperationFailedError

Inherits:
FileSystemError
  • Object
show all
Defined in:
lib/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.



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

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

Instance Attribute Details

#operationObject (readonly)

Returns the value of attribute operation.



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

def operation
  @operation
end

Instance Method Details

#messageObject



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

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