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 <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2025-03-20 13:30:05 +01:00 committed by Wolfgang Bumiller
parent 25c08ad247
commit 10cf5ed7b4

View File

@ -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 {