mirror of
https://github.com/callumio/suck.git
synced 2025-12-17 03:29:21 +00:00
fix: implement error for error types
Fixes the failing doctests
This commit is contained in:
parent
33f6d33a15
commit
828c06e872
2 changed files with 8 additions and 1 deletions
|
|
@ -14,5 +14,6 @@ categories = []
|
||||||
exclude = ["flake.nix", "flake.lock", ".envrc", "cliff.toml", "release-plz.toml", "rustfmt.toml", ".github"]
|
exclude = ["flake.nix", "flake.lock", ".envrc", "cliff.toml", "release-plz.toml", "rustfmt.toml", ".github"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
thiserror = "2.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,21 @@
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
/// Errors that can occur when using the suck channel
|
/// Errors that can occur when using the suck channel
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Error, Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// Channel has been closed gracefully
|
/// Channel has been closed gracefully
|
||||||
|
#[error("Channel closed")]
|
||||||
ChannelClosed,
|
ChannelClosed,
|
||||||
|
|
||||||
/// Producer has disconnected unexpectedly
|
/// Producer has disconnected unexpectedly
|
||||||
|
#[error("Producer disconnected")]
|
||||||
ProducerDisconnected,
|
ProducerDisconnected,
|
||||||
|
|
||||||
/// No value source has been set
|
/// No value source has been set
|
||||||
|
#[error("Producer has not set a source value")]
|
||||||
NoSource,
|
NoSource,
|
||||||
|
|
||||||
/// Internal error (e.g., mutex poisoning or source execution failure)
|
/// Internal error (e.g., mutex poisoning or source execution failure)
|
||||||
|
#[error("Internal error occured")] // TODO: Expand on this
|
||||||
InternalError,
|
InternalError,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue