mock_store/error.rs
1#[derive(Debug)]
2pub enum Error {
3 FailToDeleteNoStoreForType,
4 FailToUpdateNoStoreForType,
5 // -- Serde/Json error wrappers.
6 FailFromOrToJsonValue,
7}
8
9impl From<serde_json::Error> for Error {
10 fn from(_: serde_json::Error) -> Self {
11 Error::FailFromOrToJsonValue
12 }
13}
14
15// region: --- Error Boiler
16impl std::fmt::Display for Error {
17 fn fmt(&self, fmt: &mut std::fmt::Formatter) -> core::result::Result<(), std::fmt::Error> {
18 write!(fmt, "{self:?}")
19 }
20}
21
22impl std::error::Error for Error {}
23// endregion: --- Error Boiler