mirror of
https://git.proxmox.com/git/proxmox
synced 2025-06-14 20:50:33 +00:00
client: improve api error message (avoid duplicate status code)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
ddc154e5cd
commit
b31ab119bb
@ -53,7 +53,7 @@ impl fmt::Display for Error {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::Unauthorized => f.write_str("unauthorized"),
|
Self::Unauthorized => f.write_str("unauthorized"),
|
||||||
Self::Api(status, msg) => write!(f, "api error (status = {status}): {msg}"),
|
Self::Api(status, msg) => write!(f, "api error (status = {}: {})", status.as_u16(), msg),
|
||||||
Self::UnexpectedData => write!(f, "api unexpectedly returned data"),
|
Self::UnexpectedData => write!(f, "api unexpectedly returned data"),
|
||||||
Self::BadApi(msg, _) => write!(f, "api returned unexpected data - {msg}"),
|
Self::BadApi(msg, _) => write!(f, "api returned unexpected data - {msg}"),
|
||||||
Self::Other(err) => f.write_str(err),
|
Self::Other(err) => f.write_str(err),
|
||||||
|
Loading…
Reference in New Issue
Block a user