mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
9f89b1c77f
commit
eac516ae47
1 changed files with 5 additions and 5 deletions
|
|
@ -141,12 +141,12 @@ impl<'de> Deserialize<'de> for Error {
|
|||
Shadow::Kind { kind } => Error::Kind(kind_from_str(&kind)),
|
||||
Shadow::Raw { code } => Error::Raw(code),
|
||||
Shadow::Dyn { kind, code, message } => {
|
||||
if let Some(code) = code {
|
||||
Error::Raw(code)
|
||||
} else if message.is_empty() {
|
||||
Error::Kind(kind_from_str(&kind))
|
||||
} else {
|
||||
if !message.is_empty() {
|
||||
Error::Custom { kind: kind_from_str(&kind), code, message: message.into() }
|
||||
} else if let Some(code) = code {
|
||||
Error::Raw(code)
|
||||
} else {
|
||||
Error::Kind(kind_from_str(&kind))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue