mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
factorize internal error macro
This commit is contained in:
parent
02277ec2cf
commit
0d3fb5ee0d
11 changed files with 62 additions and 84 deletions
|
@ -127,3 +127,15 @@ where
|
|||
let error = PayloadError(err);
|
||||
error.into()
|
||||
}
|
||||
|
||||
macro_rules! internal_error {
|
||||
($target:ty : $($other:path), *) => {
|
||||
$(
|
||||
impl From<$other> for $target {
|
||||
fn from(other: $other) -> Self {
|
||||
Self::Internal(Box::new(other))
|
||||
}
|
||||
}
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue