diff options
author | Max Knutsen <maknutse@microsoft.com> | 2019-07-16 17:26:55 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-08-01 15:36:48 +0800 |
commit | 307e1650be267b67db7be1089e0979ace460d830 (patch) | |
tree | 5c7d2a53371f84c079de722389dccbba90442c8d /BaseTools/Source/Python/Trim/Trim.py | |
parent | 76912197fabec2603f6c206f087a84265f451b32 (diff) | |
download | edk2-307e1650be267b67db7be1089e0979ace460d830.tar.gz edk2-307e1650be267b67db7be1089e0979ace460d830.tar.bz2 edk2-307e1650be267b67db7be1089e0979ace460d830.zip |
BaseTools:Add extra debugging message
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2014
Add extra debugging to improve error identification.
Error while processing file if the file is read incorrectly
This patch is going to fix that issue.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Trim/Trim.py')
-rw-r--r-- | BaseTools/Source/Python/Trim/Trim.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py index 43119bd7ff..8767b67f7e 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -73,8 +73,10 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong): try:
with open(Source, "r") as File:
Lines = File.readlines()
- except:
+ except IOError:
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
+ expect:
+ EdkLogger.error("Trim", AUTOGEN_ERROR, "TrimPreprocessedFile: Error while processing file", File=Source)
PreprocessedFile = ""
InjectedFile = ""
|