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>
This commit is contained in:
Max Knutsen
2019-07-16 17:26:55 +08:00
committed by Liming Gao
parent 76912197fa
commit 307e1650be
2 changed files with 13 additions and 7 deletions

View File

@ -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 = ""