#[non_exhaustive]pub enum PolicyError {
ParseError(String),
EvalError(String),
RequestValidationError(String),
ContextError(String),
EntityError(String),
InvalidFormat(String),
EntityAttrError(String),
}Expand description
Policy evaluation and validation errors.
Variants correspond to Cedar parse/eval errors and library validation
errors. Call sites attach human-friendly context where possible.
For example, EntityAttrError wraps attribute access failures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ParseError(String)
Failed to parse Cedar policy text.
EvalError(String)
Error during policy evaluation.
RequestValidationError(String)
Request validation failed (invalid principals, resources, or actions).
ContextError(String)
Context creation error during request processing.
EntityError(String)
Error creating or manipulating Cedar entities.
InvalidFormat(String)
Invalid format for a Cedar construct (string parsing failure).
EntityAttrError(String)
Entity attribute evaluation or access error.
Trait Implementations§
Source§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl<'de> Deserialize<'de> for PolicyError
impl<'de> Deserialize<'de> for PolicyError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PolicyError
impl Display for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ContextCreationError> for PolicyError
impl From<ContextCreationError> for PolicyError
Source§fn from(err: ContextCreationError) -> Self
fn from(err: ContextCreationError) -> Self
Converts to this type from the input type.
Source§impl From<EntitiesError> for PolicyError
impl From<EntitiesError> for PolicyError
Source§fn from(err: EntitiesError) -> Self
fn from(err: EntitiesError) -> Self
Converts to this type from the input type.
Source§impl From<EntityAttrEvaluationError> for PolicyError
impl From<EntityAttrEvaluationError> for PolicyError
Source§fn from(err: EntityAttrEvaluationError) -> Self
fn from(err: EntityAttrEvaluationError) -> Self
Converts to this type from the input type.
Source§impl From<ParseErrors> for PolicyError
impl From<ParseErrors> for PolicyError
Source§fn from(err: ParseErrors) -> Self
fn from(err: ParseErrors) -> Self
Converts to this type from the input type.
Source§impl From<RequestValidationError> for PolicyError
impl From<RequestValidationError> for PolicyError
Source§fn from(err: RequestValidationError) -> Self
fn from(err: RequestValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnsafeUnpin for PolicyError
impl UnwindSafe for PolicyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more