Improved the web page handling in case of DB error 20/71620/2
authoringitk <ingitk@amdocs.com>
Thu, 1 Nov 2018 08:01:01 +0000 (08:01 +0000)
committeringitk <ingitk@amdocs.com>
Mon, 12 Nov 2018 05:30:30 +0000 (05:30 +0000)
Issue-ID: DCAEGEN2-934

Change-Id: I13597c1d3c1f6a0c34b25644ff8b4ff2421c1c9e
Signed-off-by: ingitk <ingitk@amdocs.com>
snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/DAO/MappingFileDAOImpl.java
snmpmapper/src/main/java/org/onap/dcaegen2/services/mapper/snmpmapper/service/MappingFileServiceImpl.java

index 6bfc269..f3234bb 100644 (file)
@@ -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";
 
index f6bf27c..e5ca3a8 100644 (file)
@@ -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";
                                                }
                
                     }