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

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

Direct Known Subclasses

DefaultEnvironmentCannotBeModifiedError

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.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/chef/chef_fs/file_system/operation_not_allowed_error.rb', line 25

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.



42
43
44
# File 'lib/chef/chef_fs/file_system/operation_not_allowed_error.rb', line 42

def entry
  @entry
end

#operationObject (readonly)

Returns the value of attribute operation.



41
42
43
# File 'lib/chef/chef_fs/file_system/operation_not_allowed_error.rb', line 41

def operation
  @operation
end