Method: Chef::ChefFS::FileSystem::OperationNotAllowedError#initialize

Defined in:
lib/chef/chef_fs/file_system/exceptions.rb

#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