mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-09 05:35:41 +00:00
Improve deserr error for unknown values
This commit is contained in:
parent
4acfb9a1ec
commit
754def5512
@ -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…
x
Reference in New Issue
Block a user