From cf300b2c58fecf89840547f8ef1b20c6caf935b9 Mon Sep 17 00:00:00 2001 From: ingitk Date: Thu, 1 Nov 2018 08:01:01 +0000 Subject: Improved the web page handling in case of DB error Issue-ID: DCAEGEN2-934 Change-Id: I13597c1d3c1f6a0c34b25644ff8b4ff2421c1c9e Signed-off-by: ingitk --- .../dcaegen2/services/mapper/snmpmapper/DAO/MappingFileDAOImpl.java | 1 + .../services/mapper/snmpmapper/service/MappingFileServiceImpl.java | 2 ++ 2 files changed, 3 insertions(+) (limited to 'snmpmapper') diff --git a/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/DAO/MappingFileDAOImpl.java b/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/DAO/MappingFileDAOImpl.java index 6bfc269..f3234bb 100644 --- a/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/DAO/MappingFileDAOImpl.java +++ b/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/DAO/MappingFileDAOImpl.java @@ -102,6 +102,7 @@ public class MappingFileDAOImpl implements MappingFileDAO { }catch (Exception e) { LOGGER.error("Error occured due to :" + e.getMessage()); + throw e; } return "Uploaded successfully"; diff --git a/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/service/MappingFileServiceImpl.java b/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/service/MappingFileServiceImpl.java index f6bf27c..e5ca3a8 100644 --- a/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/service/MappingFileServiceImpl.java +++ b/snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/service/MappingFileServiceImpl.java @@ -75,9 +75,11 @@ public class MappingFileServiceImpl implements MappingFileService { LOGGER.error(snmpMapperException.getMessage()); } catch (IOException e) { LOGGER.error("IOException occured:{}",e.getCause()); + return "failed"; } catch (SQLException e) { // TODO Auto-generated catch block LOGGER.error("SQLException occured:{}",e.getCause()); + return "failed"; } } -- cgit 1.2.3-korg