pub enum PolicyError {
Blacklisted {
address: String,
},
NotWhitelisted {
address: String,
},
ExceedsTransactionLimit {
limit: String,
amount: String,
},
InvalidConfiguration {
context: String,
},
}Expand description
Errors that can occur during policy evaluation.
Note: These are evaluation errors, not policy denials. For denials,
see TxGateError::PolicyDenied.
Variants§
Blacklisted
The address is on the blacklist.
NotWhitelisted
The address is not on the whitelist (when whitelist is enabled).
ExceedsTransactionLimit
The transaction amount exceeds the per-transaction limit.
InvalidConfiguration
The policy configuration is invalid.
Implementations§
Source§impl PolicyError
impl PolicyError
Sourcepub fn blacklisted(address: impl Into<String>) -> Self
pub fn blacklisted(address: impl Into<String>) -> Self
Create a Blacklisted error.
Sourcepub fn not_whitelisted(address: impl Into<String>) -> Self
pub fn not_whitelisted(address: impl Into<String>) -> Self
Create a NotWhitelisted error.
Sourcepub fn exceeds_transaction_limit(
limit: impl Into<String>,
amount: impl Into<String>,
) -> Self
pub fn exceeds_transaction_limit( limit: impl Into<String>, amount: impl Into<String>, ) -> Self
Create an ExceedsTransactionLimit error.
Sourcepub fn invalid_configuration(context: impl Into<String>) -> Self
pub fn invalid_configuration(context: impl Into<String>) -> Self
Create an InvalidConfiguration error.
Sourcepub fn denial_reason(&self) -> String
pub fn denial_reason(&self) -> String
Convert this policy error into a denial reason string.
Trait Implementations§
Source§impl Debug for PolicyError
impl Debug for PolicyError
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<PolicyError> for SigningError
impl From<PolicyError> for SigningError
Source§fn from(source: PolicyError) -> Self
fn from(source: PolicyError) -> Self
Converts to this type from the input type.
Source§impl From<PolicyError> for TxGateError
impl From<PolicyError> for TxGateError
Source§fn from(source: PolicyError) -> Self
fn from(source: PolicyError) -> 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 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