pub enum RegentError {
Show 26 variants
FailureToFindGroupContent,
FailureToParseContent(String),
FailureToRunCommand(String),
FailureToEstablishConnection(String),
FailedInitialization(String),
FailedTcpBinding(String),
FailedTaskDryRun(String),
FailedDryRunEvaluation(String),
FailedToApplyExpectedState(String),
FailedToGetSecret(String),
FailureToConsiderContext(String),
MissingInitialization(String),
GroupNotFound,
MissingGroupsList,
WorkFlowNotFollowed(String),
WrongInitialization(String),
AnyOtherError(String),
IncoherentExpectedState(String),
InternalLogicError(String),
NotConnectedToHost,
ProblemWithHostConnection(String),
SecretsIssue(String),
AttributeError(String),
TimeOutReached(String),
FailedToGetFile(String),
IncompatibleHost(String),
}Expand description
The primary error type for Regent SDK operations.
All operations in Regent SDK return this error type, which provides detailed information about what went wrong during execution.
§Error Variants
FailureToFindGroupContent: Could not locate group informationFailureToParseContent: Parsing errors (YAML, JSON, etc.)FailureToRunCommand: Command execution failedFailureToEstablishConnection: Connection to host failedFailedInitialization: Initialization or setup errorFailedTcpBinding: TCP binding failedFailedTaskDryRun: Dry run of a task failedFailedDryRunEvaluation: Evaluation during dry run failedFailedToApplyExpectedState: Could not apply the expected stateFailedToGetSecret: Secret retrieval failedFailureToConsiderContext: Template context rendering failedMissingInitialization: Required initialization was missingGroupNotFound: Requested group does not existMissingGroupsList: Groups list was not providedWorkFlowNotFollowed: Required workflow was not followedWrongInitialization: Initialization was incorrectAnyOtherError: Generic error wrapperIncoherentExpectedState: Expected state definition was inconsistentInternalLogicError: Internal library error (please report)NotConnectedToHost: Operation attempted without active connectionProblemWithHostConnection: Connection issue with hostSecretsIssue: Problem with secret managementAttributeError: Issue with an attribute definition or executionTimeOutReached: Operation timed out
§Example
use regent_sdk::RegentError;
fn handle_error(e: RegentError) {
match e {
RegentError::NotConnectedToHost => {
eprintln!("Please connect to the host first");
}
RegentError::TimeOutReached(msg) => {
eprintln!("Operation timed out: {}", msg);
}
RegentError::FailedToGetSecret(msg) => {
eprintln!("Secret retrieval failed: {}", msg);
}
_ => {
eprintln!("An error occurred: {:?}", e);
}
}
}Variants§
FailureToFindGroupContent
FailureToParseContent(String)
FailureToRunCommand(String)
FailureToEstablishConnection(String)
FailedInitialization(String)
FailedTcpBinding(String)
FailedTaskDryRun(String)
FailedDryRunEvaluation(String)
FailedToApplyExpectedState(String)
FailedToGetSecret(String)
FailureToConsiderContext(String)
MissingInitialization(String)
GroupNotFound
MissingGroupsList
WorkFlowNotFollowed(String)
WrongInitialization(String)
AnyOtherError(String)
IncoherentExpectedState(String)
InternalLogicError(String)
NotConnectedToHost
ProblemWithHostConnection(String)
SecretsIssue(String)
AttributeError(String)
TimeOutReached(String)
FailedToGetFile(String)
IncompatibleHost(String)
Trait Implementations§
Source§impl Clone for RegentError
impl Clone for RegentError
Source§fn clone(&self) -> RegentError
fn clone(&self) -> RegentError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegentError
impl Debug for RegentError
Source§impl Display for RegentError
impl Display for RegentError
Source§impl Error for RegentError
impl Error for RegentError
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()
Auto Trait Implementations§
impl Freeze for RegentError
impl RefUnwindSafe for RegentError
impl Send for RegentError
impl Sync for RegentError
impl Unpin for RegentError
impl UnsafeUnpin for RegentError
impl UnwindSafe for RegentError
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