From 307e1650be267b67db7be1089e0979ace460d830 Mon Sep 17 00:00:00 2001 From: Max Knutsen Date: Tue, 16 Jul 2019 17:26:55 +0800 Subject: 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 Cc: Liming Gao Signed-off-by: Zhiju.Fan Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Liming Gao --- BaseTools/Source/Python/Trim/Trim.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Trim/Trim.py') 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 = "" -- cgit v1.2.3