Exception: Insika::PolicyDenied

Inherits:
Error
  • Object
show all
Defined in:
lib/insika/errors.rb

Overview

Policy Engine denied -> :policy_denied event, task :failed

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, policy: nil, reason: nil) ⇒ PolicyDenied

Returns a new instance of PolicyDenied.



16
17
18
19
20
# File 'lib/insika/errors.rb', line 16

def initialize(message = nil, policy: nil, reason: nil)
  @policy = policy
  @reason = reason
  super(message || "policy #{policy} denied: #{reason}")
end

Instance Attribute Details

#policyObject (readonly)

Returns the value of attribute policy.



14
15
16
# File 'lib/insika/errors.rb', line 14

def policy
  @policy
end

#reasonObject (readonly)

Returns the value of attribute reason.



14
15
16
# File 'lib/insika/errors.rb', line 14

def reason
  @reason
end