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

Inherits:
FileSystemError 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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OperationNotAllowedError.



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

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

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



31
32
33
# File 'lib/chef/chef_fs/file_system/operation_not_allowed_error.rb', line 31

def entry
  @entry
end

#operationObject (readonly)

Returns the value of attribute operation.



30
31
32
# File 'lib/chef/chef_fs/file_system/operation_not_allowed_error.rb', line 30

def operation
  @operation
end

Instance Method Details

#reasonObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chef/chef_fs/file_system/operation_not_allowed_error.rb', line 33

def 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
end