1use thiserror::Error;
2
3#[derive(Error, Debug, Clone, Copy)]
5#[error("Item not found")]
6pub struct NotFoundError;
7
8#[derive(Debug, Clone, Copy, Error, PartialEq)]
10pub enum ToxicUpdateError {
11 #[error("Toxic not found")]
13 NotFound,
14 #[error("Other error")]
16 Other,
17}
18
19impl From<NotFoundError> for ToxicUpdateError {
20 fn from(_: NotFoundError) -> Self {
21 ToxicUpdateError::NotFound
22 }
23}
24
25#[cfg(test)]
26mod tests {
27 use super::*;
28
29 #[test]
30 fn test_not_found() {
31 let input = NotFoundError;
32 let _err: ToxicUpdateError = input.into();
33 }
34}