From 10cf5ed7b4f7ae8f396d2ed557cda651375c2c39 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Thu, 20 Mar 2025 13:30:05 +0100 Subject: [PATCH] rest-server: worker task: include context in state error message Currently the anyhow error context of a given error is not included in the error message, as `to_string` does use the default formatting [0]. Include the error context, formatting it as single line as the message is also shown to the users in e.g. the Proxmox Backup Severs task state in the UI. [0] https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations Signed-off-by: Christian Ebner --- proxmox-rest-server/src/worker_task.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs index 2968a68c..a3a65add 100644 --- a/proxmox-rest-server/src/worker_task.rs +++ b/proxmox-rest-server/src/worker_task.rs @@ -1003,7 +1003,7 @@ impl WorkerTask { if let Err(err) = result { TaskState::Error { - message: err.to_string(), + message: format!("{err:#}"), endtime, } } else if warn_count > 0 {