Class PolicyViolationException
Exception thrown when a mutation is blocked by a policy.
Implements
Inherited Members
Namespace: ModularityKit.Mutator.Abstractions.Exceptions
Assembly: ModularityKit.Mutator.dll
Syntax
public sealed class PolicyViolationException : MutationException, ISerializable
Remarks
PolicyViolationException is raised whenever a mutation is rejected by one or more IMutationPolicy<TState> evaluations. This exception provides access to the PolicyDecision that caused the blockage, including the reason and severity.
Typical usage scenarios:
- Mutations violating security, configuration, or business rules.
- Mutations requiring approval or additional preconditions.
- Mutations that exceed risk thresholds or compliance requirements.
Constructors
| Edit this page View SourcePolicyViolationException(PolicyDecision)
Exception thrown when a mutation is blocked by a policy.
Declaration
public PolicyViolationException(PolicyDecision decision)
Parameters
| Type | Name | Description |
|---|---|---|
| PolicyDecision | decision | The policy decision that blocked the mutation. |
Remarks
PolicyViolationException is raised whenever a mutation is rejected by one or more IMutationPolicy<TState> evaluations. This exception provides access to the PolicyDecision that caused the blockage, including the reason and severity.
Typical usage scenarios:
- Mutations violating security, configuration, or business rules.
- Mutations requiring approval or additional preconditions.
- Mutations that exceed risk thresholds or compliance requirements.
Properties
| Edit this page View SourceDecision
The policy decision that caused the mutation to be blocked.
Declaration
public PolicyDecision Decision { get; }
Property Value
| Type | Description |
|---|---|
| PolicyDecision |