mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
BaseTools: Improve error messages from UefiCapsuleHeader.py
Instead of throwing ValueErrors with no explanation, add a message explaining what went wrong. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
This commit is contained in:
parent
e508c6c08a
commit
5b2d55533b
@ -91,9 +91,9 @@ class UefiCapsuleHeaderClass (object):
|
||||
Buffer[0:self._StructSize]
|
||||
)
|
||||
if HeaderSize < self._StructSize:
|
||||
raise ValueError
|
||||
raise ValueError("HeaderSize of {0} doesn't match _StructSize of {1}".format(HeaderSize, self._StructSize))
|
||||
if CapsuleImageSize != len (Buffer):
|
||||
raise ValueError
|
||||
raise ValueError("CapsuleImageSize of {0} doesn't match buffer length of {1}".format(CapsuleImageSize, len(Buffer)))
|
||||
self.CapsuleGuid = uuid.UUID (bytes_le = CapsuleGuid)
|
||||
self.HeaderSize = HeaderSize
|
||||
self.OemFlags = Flags & 0xffff
|
||||
|
Loading…
x
Reference in New Issue
Block a user