diff options
author | 2016-11-28 11:32:10 +0800 | |
---|---|---|
committer | 2016-11-28 11:32:10 +0800 | |
commit | f48e46c31a7ea43739d8608aca17fd53b486fff6 (patch) | |
tree | 62796213583e95a25edc15992bfa9464384c984a /catalog-core/catalog-mgr/src/main/java | |
parent | 227ce45bc31b48c6707efbca7ca461f0e7ad0b60 (diff) |
Modify the error message when basicInfo is null.
Change-Id: Ia40a670e678369a8f920a7d5b1b9298c1c7e7a6f
Issue-id:TOSCA-194
Signed-off-by: nancylizi <li.zi30@zte.com.cn>
Diffstat (limited to 'catalog-core/catalog-mgr/src/main/java')
2 files changed, 7 insertions, 1 deletions
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java index 4cf64d30..cf879d95 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java @@ -124,6 +124,12 @@ public class PackageWrapper { if (isEnd) { PackageBasicInfo basicInfo = new PackageBasicInfo(); basicInfo = PackageWrapperUtil.getPacageBasicInfo(fileLocation); + if (null == basicInfo.getType() || null == basicInfo.getProvider() + || null == basicInfo.getVersion()) { + LOG.error( + "Package basicInfo is incorrect ! basicIonfo = " + ToolUtil.objectToString(basicInfo)); + return Response.serverError().build(); + } String path = basicInfo.getType().toString() + File.separator + basicInfo.getProvider() + File.separator + fileName.replace(".csar", "") + File.separator + basicInfo.getVersion(); diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java index 3a286cd3..3e494e20 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java @@ -389,7 +389,7 @@ public class PackageWrapperUtil { } } } catch (IOException e1) { - LOG.error("judge package type error !"); + LOG.error("judge package type error ! " + e1.getMessage()); } if (isXmlCsar) { basicInfo.setFormat(CommonConstant.PACKAGE_XML_FORMAT); |