spring_batch_rs/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4/// Represents the possible errors that can occur during batch processing.
5pub enum BatchError {
6    #[error("Error occurred in the ItemWriter: {0}")]
7    /// Error occurred in the ItemWriter.
8    ItemWriter(String),
9
10    #[error("Error occurred in the ItemProcessor: {0}")]
11    /// Error occurred in the ItemProcessor.
12    ItemProcessor(String),
13
14    #[error("Error occurred in the ItemReader: {0}")]
15    /// Error occurred in the ItemReader.
16    ItemReader(String),
17
18    #[error("Error occurred in the step: {0}")]
19    /// Error occurred in the step.
20    Step(String),
21}