Sonar Fixes
[policy/engine.git] / ONAP-PAP-REST / src / main / java / org / onap / policy / pap / xacml / rest / components / ConfigPolicy.java
index 1b29c03..63a62d2 100644 (file)
@@ -63,6 +63,7 @@ import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 
+import com.att.research.xacml.api.pap.PAPException;
 import com.att.research.xacml.std.IdentifierImpl;
 
 public class ConfigPolicy extends Policy {
@@ -179,11 +180,8 @@ public class ConfigPolicy extends Policy {
                        XMLReader reader = parser.getXMLReader();
                        reader.setErrorHandler(new XMLErrorHandler());
                        reader.parse(new InputSource(new StringReader(data)));
-               } catch (ParserConfigurationException e) {
-                       return false;
-               } catch (SAXException e) {
-                       return false;
-               } catch (IOException e) {
+               } catch (ParserConfigurationException | SAXException | IOException e) {
+                       LOGGER.debug(e);
                        return false;
                }
                return true;
@@ -234,7 +232,7 @@ public class ConfigPolicy extends Policy {
        }
 
        @Override
-       public Map<String, String> savePolicies() throws Exception {
+       public Map<String, String> savePolicies() throws PAPException {
                
                Map<String, String> successMap = new HashMap<>();
                if(isPolicyExists()){
@@ -257,7 +255,7 @@ public class ConfigPolicy extends Policy {
        //This is the method for preparing the policy for saving.  We have broken it out
        //separately because the fully configured policy is used for multiple things
        @Override
-       public boolean prepareToSave() throws Exception{
+       public boolean prepareToSave() throws PAPException{
 
                if(isPreparedToSave()){
                        return true;