Changed some deprecated uses on error handling
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 3 Mar 2008 03:04:52 +0000 (03:04 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 3 Mar 2008 03:04:52 +0000 (03:04 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1042 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Trim/Trim.py

index 3f5fd60..6ddf1b1 100644 (file)
@@ -213,9 +213,9 @@ def Options():
 
     # error check
     if len(Args) == 0:
-        raise BuildToolError(OPTION_MISSING, name="Input file", usage=Parser.get_usage())
+        EdkLogger.error("Trim", OPTION_MISSING, ExtraData=Parser.get_usage())
     if len(Args) > 1:
-        raise BuildToolError(OPTION_NOT_SUPPORTED, name="Too many input files", usage=Parser.get_usage())
+        EdkLogger.error("Trim", OPTION_NOT_SUPPORTED, ExtraData=Parser.get_usage())
 
     InputFile = Args[0]
     if Options.OutputFile == None:
@@ -234,6 +234,7 @@ def Options():
 #
 def Main():
     try:
+        EdkLogger.Initialize()
         CommandOptions, InputFile = Options()
         if CommandOptions.LogLevel < EdkLogger.DEBUG_9:
             EdkLogger.SetLevel(CommandOptions.LogLevel + 1)