mirror of
https://github.com/clearlinux/mixer-tools.git
synced 2026-04-28 10:53:56 +00:00
Identify manifest in logging
Improve the usability of log messages by indicating which manifest is invalid when printing errors. Signed-off-by: William Douglas <william.douglas@intel.com>
This commit is contained in:
committed by
William Douglas
parent
4d475a28b8
commit
e5966cbe5a
@@ -187,18 +187,18 @@ func readManifestFileEntry(fields []string, m *Manifest) error {
|
||||
// CheckHeaderIsValid verifies that all header fields in the manifest are valid.
|
||||
func (m *Manifest) CheckHeaderIsValid() error {
|
||||
if m.Header.Format == 0 {
|
||||
return errors.New("manifest format not set")
|
||||
return errors.Errorf("manifest format not set (%s)", m.Name)
|
||||
}
|
||||
|
||||
if m.Header.Version == 0 {
|
||||
return errors.New("manifest has version zero, version must be positive")
|
||||
return errors.Errorf("manifest has version zero, version must be positive (%s)", m.Name)
|
||||
}
|
||||
if m.Header.FileCount == 0 {
|
||||
return errors.New("manifest has a zero file count")
|
||||
return fmt.Errorf("manifest has a zero file count (%s)", m.Name)
|
||||
}
|
||||
|
||||
if m.Header.TimeStamp.IsZero() {
|
||||
return errors.New("manifest timestamp not set")
|
||||
return errors.Errorf("manifest timestamp not set (%s)", m.Name)
|
||||
}
|
||||
|
||||
// Includes are not required.
|
||||
|
||||
Reference in New Issue
Block a user