From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox] schema: removed excessive newlines in error messages
Date: Fri, 1 Sep 2023 10:12:59 +0200 [thread overview]
Message-ID: <20230901081259.30375-1-g.goller@proxmox.com> (raw)
The output does not look good on console/task view when there is an
empty line after the first error and trailing newlines after
the last error. Removed the newlines.
Example:
before:
```
$ proxmox-backup-client ...
Error: parameter verification errors
parameter 'file-name': value does not match the regex pattern
$
```
now:
```
$ proxmox-backup-client ...
Error: parameter verification errors
parameter 'file-name': value does not match the regex pattern
$
```
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
proxmox-schema/src/schema.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs
index f087706..596adee 100644
--- a/proxmox-schema/src/schema.rs
+++ b/proxmox-schema/src/schema.rs
@@ -101,14 +101,14 @@ impl fmt::Display for ParameterError {
let mut msg = String::new();
if !self.is_empty() {
- msg.push_str("parameter verification errors\n\n");
+ msg.push_str("parameter verification errors\n");
}
for (name, err) in self.error_list.iter() {
let _ = writeln!(msg, "parameter '{}': {}", name, err);
}
- write!(f, "{}", msg)
+ write!(f, "{}", msg.trim())
}
}
--
2.39.2
next reply other threads:[~2023-09-01 8:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 8:12 Gabriel Goller [this message]
2023-10-11 11:06 ` Gabriel Goller
2023-10-18 17:22 ` Thomas Lamprecht
2023-10-23 7:51 ` Gabriel Goller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230901081259.30375-1-g.goller@proxmox.com \
--to=g.goller@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.