mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-02 12:11:40 +00:00
schema: fixup empty error list handling
Some(<empty list of errors>) does not actually signal an error... Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
aa10025366
commit
c702638bd8
@ -37,7 +37,8 @@ impl SchemaGuard {
|
||||
/// If this is the "final" guard, take out the errors:
|
||||
fn errors(self) -> Option<Vec<(String, anyhow::Error)>> {
|
||||
if self.0.is_none() {
|
||||
Some(ERRORS.with(|e| mem::take(&mut *e.borrow_mut())))
|
||||
let errors = ERRORS.with(|e| mem::take(&mut *e.borrow_mut()));
|
||||
(!errors.is_empty()).then_some(errors)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user