From: wuyizhong Date: Fri, 18 Aug 2006 09:39:01 +0000 (+0000) Subject: Report error messages more precise. X-Git-Tag: edk2-stable201903~24550 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e485bb4bff9dbd617d73f2b93b840c4e2c54d6db Report error messages more precise. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1323 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java index 5cb8e6f3e9..74a2d4fe43 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java @@ -412,7 +412,7 @@ public class GlobalData { return msaMap; } catch (Exception ex){ - throw new BuildException(ex.getMessage()); + throw new BuildException("Parsing MSA file [" + msaFile.getPath() + "] error. \n" + ex.getMessage() ); } } @@ -598,7 +598,7 @@ public class GlobalData { return packageId; } } - throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!"); + throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!"); } public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException { @@ -606,7 +606,7 @@ public class GlobalData { moduleId.setPackage(packageId); Spd spd = spdTable.get(packageId); if (spd == null) { - throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!"); + throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!"); } Set modules = spd.getModules(); Iterator iter = modules.iterator(); @@ -619,7 +619,7 @@ public class GlobalData { return moduleId; } } - throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!"); + throw new BuildException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!"); } public synchronized static Set getPackageList(){ diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/Spd.java b/Tools/Source/GenBuild/org/tianocore/build/global/Spd.java index 8772385e4b..63568b3886 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/Spd.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/Spd.java @@ -198,8 +198,7 @@ public class Spd { } } catch (Exception e) { - e.setStackTrace(e.getStackTrace()); - throw new BuildException("Parse of the package description file [" + packageId.getSpdFile() + "] failed!\n" + throw new BuildException("Parse of the package description file [" + packageFile.getPath() + "] failed!\n" + e.getMessage()); } } diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java b/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java index 5c77e8eb67..677d096274 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java +++ b/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java @@ -110,6 +110,15 @@ public class Identification { return version; } + public String toGuidString() { + if (version == null || version.trim().equalsIgnoreCase("")) { + return "[" + guid + "]"; + } + else { + return "[" + guid + "] and version [" + version + "]"; + } + } + /* (non-Javadoc) @see java.lang.Object#hashCode() **/