vmm: Include invalid UUID string in ParseUuid err
On-behalf-of: SAP leander.kohler@sap.com Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
This commit is contained in:
parent
8e51c57aea
commit
adfcd17bfc
1 changed files with 3 additions and 3 deletions
|
|
@ -33,8 +33,8 @@ pub enum Error {
|
||||||
#[error("Failure to write additional data to memory")]
|
#[error("Failure to write additional data to memory")]
|
||||||
WriteData,
|
WriteData,
|
||||||
/// Failure to parse uuid, uuid format may be error
|
/// Failure to parse uuid, uuid format may be error
|
||||||
#[error("Failure to parse uuid")]
|
#[error("Failure to parse uuid: {1}")]
|
||||||
ParseUuid(#[source] uuid::Error),
|
ParseUuid(#[source] uuid::Error, String),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Result<T> = result::Result<T, Error>;
|
pub type Result<T> = result::Result<T, Error>;
|
||||||
|
|
@ -198,7 +198,7 @@ pub fn setup_smbios(
|
||||||
let uuid_number = uuid
|
let uuid_number = uuid
|
||||||
.map(Uuid::parse_str)
|
.map(Uuid::parse_str)
|
||||||
.transpose()
|
.transpose()
|
||||||
.map_err(Error::ParseUuid)?
|
.map_err(|e| Error::ParseUuid(e, uuid.unwrap().to_string()))?
|
||||||
.unwrap_or(Uuid::nil());
|
.unwrap_or(Uuid::nil());
|
||||||
let smbios_sysinfo = SmbiosSysInfo {
|
let smbios_sysinfo = SmbiosSysInfo {
|
||||||
r#type: SYSTEM_INFORMATION,
|
r#type: SYSTEM_INFORMATION,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue