Exception: Chef::ChefFS::FileSystem::OperationNotAllowedError

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

Instance Attribute Summary collapse

Attributes inherited from FileSystemError

#cause, #reason

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OperationNotAllowedError


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/chef/chef_fs/file_system/exceptions.rb', line 65

def initialize(operation, entry, cause = nil, reason = nil)
  reason ||=
    case operation
    when :delete
      "cannot be deleted"
    when :write
      "cannot be updated"
    when :create_child
      "cannot have a child created under it"
    when :read
      "cannot be read"
    end
  super(entry, cause, reason)
  @operation = operation
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry


82
83
84
# File 'lib/chef/chef_fs/file_system/exceptions.rb', line 82

def entry
  @entry
end

#operationObject (readonly)

Returns the value of attribute operation


81
82
83
# File 'lib/chef/chef_fs/file_system/exceptions.rb', line 81

def operation
  @operation
end