pub enum Error {
Show 21 variants
NotFound(String),
ConfigMismatch,
AlreadyExists(String),
InvalidOffset(String),
InvalidStreamName(String),
ContentTypeMismatch {
expected: String,
actual: String,
},
StreamClosed,
SequenceRegression {
expected: u64,
actual: u64,
},
SequenceGap {
expected: u64,
actual: u64,
},
EpochFenced {
current: u64,
received: u64,
},
InvalidProducerState(String),
MemoryLimitExceeded,
StreamSizeLimitExceeded,
InvalidTtl(String),
ConflictingExpiration,
StreamExpired,
InvalidJson(String),
EmptyBody,
InvalidHeader {
header: String,
reason: String,
},
SeqOrderingViolation {
last: String,
received: String,
},
Storage(String),
}Expand description
Single error type for all storage and protocol operations
Maps to HTTP status codes in handlers. Following the single error enum pattern to avoid error type proliferation.
Variants§
NotFound(String)
Stream not found (404)
ConfigMismatch
Stream already exists with different config (409)
AlreadyExists(String)
Stream already exists (used for idempotent operations)
InvalidOffset(String)
Invalid offset format (400)
InvalidStreamName(String)
Invalid stream name (400)
ContentTypeMismatch
Content type mismatch (409)
StreamClosed
Stream is closed (409)
SequenceRegression
Producer sequence regression (409)
SequenceGap
Producer sequence gap (409)
EpochFenced
Producer epoch fenced (403)
InvalidProducerState(String)
Invalid producer state (400)
MemoryLimitExceeded
Memory limit exceeded (413)
StreamSizeLimitExceeded
Stream size limit exceeded (413)
InvalidTtl(String)
Invalid TTL format (400)
ConflictingExpiration
Both TTL and Expires-At provided (400)
StreamExpired
Stream has expired (404)
InvalidJson(String)
Invalid JSON (400)
EmptyBody
Empty request body when data expected (400)
InvalidHeader
Invalid header value (400)
SeqOrderingViolation
Stream-Seq ordering violation (409)
Storage(String)
Storage backend I/O or serialization error (500)
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
use the Display impl or to_string()
Source§impl IntoResponse for Error
Convert Error to HTTP response
impl IntoResponse for Error
Convert Error to HTTP response