mirror of
https://github.com/callumio/suck.git
synced 2025-12-17 11:39:20 +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
|
|
@ -1,15 +1,21 @@
|
|||
use thiserror::Error;
|
||||
|
||||
/// Errors that can occur when using the suck channel
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Error, Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Error {
|
||||
/// Channel has been closed gracefully
|
||||
#[error("Channel closed")]
|
||||
ChannelClosed,
|
||||
|
||||
/// Producer has disconnected unexpectedly
|
||||
#[error("Producer disconnected")]
|
||||
ProducerDisconnected,
|
||||
|
||||
/// No value source has been set
|
||||
#[error("Producer has not set a source value")]
|
||||
NoSource,
|
||||
|
||||
/// Internal error (e.g., mutex poisoning or source execution failure)
|
||||
#[error("Internal error occured")] // TODO: Expand on this
|
||||
InternalError,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue