]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
To locate module precisely in stand-alone module build. Except Module Guid, add MSA...
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / fpd / FpdParserTask.java
index 88d7e62c8f5412ad8cb8213dfea51d6625968830..d70166dbaf5e0760daed812ca21a739247168688 100644 (file)
@@ -18,6 +18,7 @@ package org.tianocore.build.fpd;
 import java.io.BufferedWriter;\r
 import java.io.File;\r
 import java.io.FileWriter;\r
+import java.io.IOException;\r
 import java.util.HashMap;\r
 import java.util.Iterator;\r
 import java.util.LinkedHashMap;\r
@@ -30,6 +31,7 @@ import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;\r
 import org.apache.tools.ant.taskdefs.Ant;\r
 import org.apache.tools.ant.taskdefs.Property;\r
+import org.apache.xmlbeans.XmlException;\r
 import org.apache.xmlbeans.XmlObject;\r
 \r
 import org.tianocore.common.definitions.EdkDefinitions;\r
@@ -277,8 +279,10 @@ public class FpdParserTask extends Task {
                 bw.flush();\r
                 bw.close();\r
                 fw.close();\r
-            } catch (Exception e) {\r
-                throw new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + e.getMessage());\r
+            } catch (IOException ex) {\r
+                BuildException buildException = new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + ex.getMessage());\r
+                buildException.setStackTrace(ex.getStackTrace());\r
+                throw buildException;\r
             }\r
         }\r
     }\r
@@ -289,7 +293,7 @@ public class FpdParserTask extends Task {
       @throws BuildException\r
                   FPD file is not valid.\r
     **/\r
-    public void parseFpdFile(File fpdFile) throws BuildException {\r
+    public void parseFpdFile(File fpdFile) throws BuildException, EdkException {\r
         this.fpdFile = fpdFile;\r
         parseFpdFile();\r
     }\r
@@ -362,8 +366,18 @@ public class FpdParserTask extends Task {
             //\r
             PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();\r
             ca.perform(platformId.getFpdFile().getPath(), ActionMessage.NULL_MESSAGE_LEVEL);\r
-        } catch (Exception e) {\r
-            throw new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + e.getMessage());\r
+        } catch (IOException ex) {\r
+            BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
+            buildException.setStackTrace(ex.getStackTrace());\r
+            throw buildException;\r
+        } catch (XmlException ex) {\r
+            BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
+            buildException.setStackTrace(ex.getStackTrace());\r
+            throw buildException;\r
+        } catch (EdkException ex) {\r
+            BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
+            buildException.setStackTrace(ex.getStackTrace());\r
+            throw buildException;\r
         }\r
     }\r
 \r