mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-13 16:08:00 +00:00
release: add proper error message
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
0e84522116
commit
26e2bce4a7
@ -93,6 +93,7 @@ impl FileReferenceType {
|
||||
other => bail!("Unexpected file extension '{other}'."),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse(component: &str, path: &str) -> Result<FileReferenceType, Error> {
|
||||
// everything referenced in a release file should be component-specific
|
||||
let rest = path
|
||||
@ -440,7 +441,9 @@ fn parse_file_reference(
|
||||
components: &[String],
|
||||
) -> Result<(FileReference, Vec<u8>), Error> {
|
||||
let mut split = line.split_ascii_whitespace();
|
||||
let checksum = split.next().ok_or_else(|| format_err!("bla"))?;
|
||||
let checksum = split
|
||||
.next()
|
||||
.ok_or_else(|| format_err!("No 'checksum' field in the file reference line."))?;
|
||||
if checksum.len() > csum_len * 2 {
|
||||
bail!(
|
||||
"invalid checksum length: '{}', expected {} bytes",
|
||||
|
Loading…
Reference in New Issue
Block a user