From 799336459db1adb340563d9b06f673645dba30ce Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 21 May 2025 13:32:47 +0200 Subject: [PATCH] misc: performance-metrics: streamline #[source] and Error impl This streamlines the Error implementation in the Cloud Hypervisor code base to match the remaining parts so that everything follows the agreed conventions. These are leftovers missed in the previous commits. Signed-off-by: Philipp Schuster On-behalf-of: SAP philipp.schuster@sap.com --- performance-metrics/src/performance_tests.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/performance-metrics/src/performance_tests.rs b/performance-metrics/src/performance_tests.rs index 83c356e88..f398d7977 100644 --- a/performance-metrics/src/performance_tests.rs +++ b/performance-metrics/src/performance_tests.rs @@ -10,6 +10,7 @@ use std::time::Duration; use std::{fs, thread}; use test_infra::{Error as InfraError, *}; +use thiserror::Error; use crate::{mean, PerformanceTestControl}; @@ -19,10 +20,13 @@ pub const FOCAL_IMAGE_NAME: &str = "focal-server-cloudimg-amd64-custom-20210609- pub const FOCAL_IMAGE_NAME: &str = "focal-server-cloudimg-arm64-custom-20210929-0-update-tool.raw"; #[allow(dead_code)] -#[derive(Debug)] +#[derive(Error, Debug)] enum Error { + #[error("boot time could not be parsed")] BootTimeParse, - Infra(InfraError), + #[error("infrastructure failure: {0}")] + Infra(#[source] InfraError), + #[error("restore time could not be parsed")] RestoreTimeParse, }