pub enum TestError {
Show 19 variants
ExecutionFailed(DurableError),
OperationNotFound(String),
OperationTypeMismatch {
expected: OperationType,
found: OperationType,
},
NotCallbackOperation,
FunctionNotRegistered(String),
WaitTimeout(String),
ExecutionCompletedEarly(String, WaitingOperationStatus),
SerializationError(Error),
AwsError(String),
EnvironmentNotSetUp,
InvalidConfiguration(String),
ResultNotAvailable(String),
InvalidCheckpointToken(String),
CheckpointServerError(String),
CheckpointCommunicationError(String),
ExecutionNotFound(String),
InvocationNotFound(String),
CallbackAlreadyCompleted(String),
CallbackNotFound(String),
}Expand description
Errors that can occur during testing.
This enum covers all possible error conditions that can occur when using the testing utilities.
§Examples
use durable_execution_sdk_testing::TestError;
// Operation not found
let err = TestError::OperationNotFound("my-step".to_string());
assert!(err.to_string().contains("my-step"));
// Type mismatch
let err = TestError::OperationTypeMismatch {
expected: durable_execution_sdk::OperationType::Step,
found: durable_execution_sdk::OperationType::Wait,
};
assert!(err.to_string().contains("Step"));Variants§
ExecutionFailed(DurableError)
The handler execution failed.
OperationNotFound(String)
Operation not found.
OperationTypeMismatch
Wrong operation type for the requested details.
Fields
expected: OperationTypeThe expected operation type
found: OperationTypeThe actual operation type found
NotCallbackOperation
Callback operation required but not found.
FunctionNotRegistered(String)
Function not registered for invoke.
WaitTimeout(String)
Timeout waiting for operation.
ExecutionCompletedEarly(String, WaitingOperationStatus)
Execution completed before operation reached expected state.
SerializationError(Error)
Serialization/deserialization error.
AwsError(String)
AWS SDK error.
EnvironmentNotSetUp
Test environment not set up.
InvalidConfiguration(String)
Invalid configuration.
ResultNotAvailable(String)
Result not available (execution not complete or failed).
InvalidCheckpointToken(String)
Invalid checkpoint token.
CheckpointServerError(String)
Checkpoint server error.
CheckpointCommunicationError(String)
Checkpoint communication error.
ExecutionNotFound(String)
Execution not found.
InvocationNotFound(String)
Invocation not found.
CallbackAlreadyCompleted(String)
Callback already completed.
CallbackNotFound(String)
Callback not found.
Implementations§
Source§impl TestError
impl TestError
Sourcepub fn operation_not_found(name: impl Into<String>) -> Self
pub fn operation_not_found(name: impl Into<String>) -> Self
Creates a new OperationNotFound error.
Sourcepub fn type_mismatch(expected: OperationType, found: OperationType) -> Self
pub fn type_mismatch(expected: OperationType, found: OperationType) -> Self
Creates a new OperationTypeMismatch error.
Sourcepub fn function_not_registered(name: impl Into<String>) -> Self
pub fn function_not_registered(name: impl Into<String>) -> Self
Creates a new FunctionNotRegistered error.
Sourcepub fn wait_timeout(operation: impl Into<String>) -> Self
pub fn wait_timeout(operation: impl Into<String>) -> Self
Creates a new WaitTimeout error.
Sourcepub fn execution_completed_early(
operation: impl Into<String>,
status: WaitingOperationStatus,
) -> Self
pub fn execution_completed_early( operation: impl Into<String>, status: WaitingOperationStatus, ) -> Self
Creates a new ExecutionCompletedEarly error.
Sourcepub fn invalid_configuration(message: impl Into<String>) -> Self
pub fn invalid_configuration(message: impl Into<String>) -> Self
Creates a new InvalidConfiguration error.
Sourcepub fn result_not_available(message: impl Into<String>) -> Self
pub fn result_not_available(message: impl Into<String>) -> Self
Creates a new ResultNotAvailable error.
Sourcepub fn invalid_checkpoint_token(message: impl Into<String>) -> Self
pub fn invalid_checkpoint_token(message: impl Into<String>) -> Self
Creates a new InvalidCheckpointToken error.
Sourcepub fn checkpoint_server_error(message: impl Into<String>) -> Self
pub fn checkpoint_server_error(message: impl Into<String>) -> Self
Creates a new CheckpointServerError.
Sourcepub fn checkpoint_communication_error(message: impl Into<String>) -> Self
pub fn checkpoint_communication_error(message: impl Into<String>) -> Self
Creates a new CheckpointCommunicationError.
Sourcepub fn execution_not_found(message: impl Into<String>) -> Self
pub fn execution_not_found(message: impl Into<String>) -> Self
Creates a new ExecutionNotFound error.
Sourcepub fn invocation_not_found(message: impl Into<String>) -> Self
pub fn invocation_not_found(message: impl Into<String>) -> Self
Creates a new InvocationNotFound error.
Sourcepub fn callback_already_completed(message: impl Into<String>) -> Self
pub fn callback_already_completed(message: impl Into<String>) -> Self
Creates a new CallbackAlreadyCompleted error.
Sourcepub fn callback_not_found(message: impl Into<String>) -> Self
pub fn callback_not_found(message: impl Into<String>) -> Self
Creates a new CallbackNotFound error.
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Returns true if this error is retriable.
Trait Implementations§
Source§impl Error for TestError
impl Error for TestError
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<DurableError> for TestError
impl From<DurableError> for TestError
Source§fn from(source: DurableError) -> Self
fn from(source: DurableError) -> Self
Auto Trait Implementations§
impl Freeze for TestError
impl !RefUnwindSafe for TestError
impl Send for TestError
impl Sync for TestError
impl Unpin for TestError
impl UnsafeUnpin for TestError
impl !UnwindSafe for TestError
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
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>
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>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.