pub enum EvaluationError {
Show 13 variants
EntityDoesNotExist(Arc<EntityUID>),
EntityAttrDoesNotExist {
entity: Arc<EntityUID>,
attr: SmolStr,
},
UnspecifiedEntityAccess(SmolStr),
RecordAttrDoesNotExist(SmolStr),
ExtensionsError(ExtensionsError),
TypeError {
expected: Vec<Type>,
actual: Type,
},
WrongNumArguments {
op: ExtensionFunctionOp,
expected: usize,
actual: usize,
},
IntegerOverflow(IntegerOverflowError),
InvalidRestrictedExpression(RestrictedExpressionError),
TemplateInstantiationError(SlotId),
ExtensionError {
extension_name: Name,
msg: String,
},
NonValue(Expr),
RecursionLimit,
}
Expand description
Error type for various kinds of errors that can be raised by the policy evaluator.
Variants§
EntityDoesNotExist(Arc<EntityUID>)
Tried to lookup this entity UID, but it didn’t exist in the provided entities
EntityAttrDoesNotExist
Fields
Tried to get this attribute, but the specified entity didn’t have that attribute
UnspecifiedEntityAccess(SmolStr)
Tried to access an attribute of an unspecified entity
RecordAttrDoesNotExist(SmolStr)
Tried to get this attribute of a (non-entity) record, but that record didn’t have that attribute
ExtensionsError(ExtensionsError)
Error thown by an operation on Extensions
(not to be confused with ExtensionError
, which is an error thrown by
an individual extension function)
TypeError
Type error, showing the expected type and actual type
WrongNumArguments
Fields
op: ExtensionFunctionOp
arguments to this function
Wrong number of arguments to an extension function
IntegerOverflow(IntegerOverflowError)
Overflow during an integer operation
InvalidRestrictedExpression(RestrictedExpressionError)
Error with the use of “restricted” expressions
TemplateInstantiationError(SlotId)
Thrown when a policy is evaluated with an un-filled slot
ExtensionError
Fields
Evaluation error thrown by an extension function
NonValue(Expr)
Error raised if an expression did not reduce to a value when it was supposed to
RecursionLimit
Maximum recursion limit reached for expression evaluation
Trait Implementations§
source§impl Clone for EvaluationError
impl Clone for EvaluationError
source§fn clone(&self) -> EvaluationError
fn clone(&self) -> EvaluationError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EvaluationError
impl Debug for EvaluationError
source§impl Display for EvaluationError
impl Display for EvaluationError
source§impl Error for EvaluationError
impl Error for EvaluationError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<ExtensionsError> for EvaluationError
impl From<ExtensionsError> for EvaluationError
source§fn from(source: ExtensionsError) -> Self
fn from(source: ExtensionsError) -> Self
source§impl From<RestrictedExpressionError> for EvaluationError
impl From<RestrictedExpressionError> for EvaluationError
source§fn from(source: RestrictedExpressionError) -> Self
fn from(source: RestrictedExpressionError) -> Self
source§impl PartialEq<EvaluationError> for EvaluationError
impl PartialEq<EvaluationError> for EvaluationError
source§fn eq(&self, other: &EvaluationError) -> bool
fn eq(&self, other: &EvaluationError) -> bool
self
and other
values to be equal, and is used
by ==
.