pub enum TelegramError {
MissingBotToken,
Startup(String),
Send {
attempts: u32,
reason: String,
},
Receive(String),
ResponseTimeout {
timeout_secs: u64,
},
State(Error),
StateParse(Error),
EventWrite(String),
}Expand description
Errors that can occur during Telegram bot operations.
Variants§
MissingBotToken
Bot token is missing from config and environment.
Startup(String)
Failed to start the Telegram bot (network, auth, etc.).
Send
Failed to send a message after retries.
Receive(String)
Failed to receive messages.
ResponseTimeout
Timed out waiting for a human response.
State(Error)
Failed to read or write state file.
StateParse(Error)
Failed to parse state JSON.
EventWrite(String)
Failed to write event to JSONL.
Trait Implementations§
Source§impl Debug for TelegramError
impl Debug for TelegramError
Source§impl Display for TelegramError
impl Display for TelegramError
Source§impl Error for TelegramError
impl Error for TelegramError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for TelegramError
impl From<Error> for TelegramError
Auto Trait Implementations§
impl Freeze for TelegramError
impl !RefUnwindSafe for TelegramError
impl Send for TelegramError
impl Sync for TelegramError
impl Unpin for TelegramError
impl !UnwindSafe for TelegramError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more