[pbs-devel] applied: [PATCH v3 proxmox 1/6] worker task: include anyhow error context in state error message

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Mar 20 14:47:22 CET 2025


(this is a duplicate - it's applied now)

On Thu, Mar 20, 2025 at 01:30:05PM +0100, Christian Ebner wrote:
> 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 at proxmox.com>
> ---
> changes since version 1:
> - not present in previous version
> 
>  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 {
> -- 
> 2.39.5




More information about the pbs-devel mailing list