mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Improve deserr error for unknown values
This commit is contained in:
parent
e54fbb0d1e
commit
f95bd11db2
@ -330,8 +330,9 @@ impl<E: DeserializeError> Deserr<E> for Action {
|
|||||||
Some(action) => Ok(action),
|
Some(action) => Ok(action),
|
||||||
None => Err(deserr::take_cf_content(E::error::<std::convert::Infallible>(
|
None => Err(deserr::take_cf_content(E::error::<std::convert::Infallible>(
|
||||||
None,
|
None,
|
||||||
deserr::ErrorKind::Unexpected {
|
deserr::ErrorKind::UnknownValue {
|
||||||
msg: format!("string must be a valid action, got {}", s),
|
value: &s,
|
||||||
|
accepted: &Self::SERDE_MAP_ARR.map(|(ser_action, _)| ser_action),
|
||||||
},
|
},
|
||||||
location,
|
location,
|
||||||
))),
|
))),
|
||||||
|
Loading…
Reference in New Issue
Block a user