Skip to main content

sinks_core/
error.rs

1use thiserror::Error;
2
3/// Result alias for sink operations.
4pub type Result<T> = std::result::Result<T, SinkError>;
5
6/// Why a sink write failed.
7#[derive(Debug, Error)]
8#[non_exhaustive]
9pub enum SinkError {
10    /// Writing to the destination failed (I/O, network, the remote rejecting it).
11    #[error("write failed: {0}")]
12    Write(String),
13
14    /// A document could not be serialized for the destination.
15    #[error("serialization failed: {0}")]
16    Serialize(String),
17}