rnotifylib/util/http_util/error.rs
1use core::fmt::{Debug, Display, Formatter};
2use std::error::Error;
3
4#[derive(Debug)]
5pub struct MessageSendError {
6 msg: String,
7}
8
9impl MessageSendError {
10 pub fn new(msg: String) -> Self {
11 Self {
12 msg,
13 }
14 }
15}
16
17impl Error for MessageSendError {}
18
19impl Display for MessageSendError {
20 fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
21 write!(f, "Error sending message: {}", self.msg)
22 }
23}