next_web_common/error/
json_object_error.rs1
2#[derive(Clone, Debug, PartialEq, Eq)]
4pub enum JsonObjectError {
5 KeyIsEmpty,
7 KeyAlreadyExists,
9 ValueIsNull,
11 KeyOrValueIsNull,
13 PaseError,
15}
16
17impl std::fmt::Display for JsonObjectError {
18 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20 match self {
21 JsonObjectError::KeyIsEmpty => write!(f, "Key is empty"),
22 JsonObjectError::KeyAlreadyExists => write!(f, "Key already exists"),
23 JsonObjectError::ValueIsNull => write!(f, "Value is null"),
24 JsonObjectError::KeyOrValueIsNull => write!(f, "Key or value is null"),
25 JsonObjectError::PaseError => write!(f, "Parse error"),
26 }
27 }
28}
29
30impl std::error::Error for JsonObjectError {}