X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateDcaeMicroServiceController.java;fp=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateDcaeMicroServiceController.java;h=c4c822005c7ed2d1945782af1a9e4219e48ab584;hb=ff0146fb327dbe5f27b0bd29640f3ace54006d92;hp=0f315a392dc7170689bd8695903a188023ef05a7;hpb=11eb39f53842dff62e81a38ab599ddbc97cf7b73;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index 0f315a392..c4c822005 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -1177,7 +1177,17 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { fileList = listModelFiles(this.directory); }else if (yml==true){ - msMLUtils.parseTosca(this.newFile); + errorMsg = msMLUtils.parseTosca(this.newFile); + if(errorMsg != null){ + PrintWriter out = response.getWriter(); + response.setCharacterEncoding("UTF-8"); + response.setContentType("application / json"); + request.setCharacterEncoding("UTF-8"); + JSONObject j = new JSONObject(); + j.put("errorMsg", errorMsg); + out.write(j.toString()); + return; + } }else { File file = new File(this.newFile);