Roberto Sánchez
2014-01-21 b83a0ba903b56562751963c106b4c20352c26087
securis/src/main/java/net/curisit/securis/services/LicenseTypeResource.java
....@@ -23,7 +23,7 @@
2323 import javax.ws.rs.core.Response.Status;
2424
2525 import net.curisit.integrity.commons.Utils;
26
-import net.curisit.securis.SecurisErrorHandler;
26
+import net.curisit.securis.DefaultExceptionHandler;
2727 import net.curisit.securis.db.Application;
2828 import net.curisit.securis.db.LicenseType;
2929 import net.curisit.securis.utils.TokenHelper;
....@@ -108,11 +108,11 @@
108108 app = em.find(Application.class, lt.getApplicationId());
109109 if (app == null) {
110110 log.error("LicenseType application with id {} not found in DB", lt.getApplicationId());
111
- return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "License type's app not found with ID: " + lt.getApplicationId()).build();
111
+ return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "License type's app not found with ID: " + lt.getApplicationId()).build();
112112 }
113113 } else {
114114 log.error("Application is missing for current license type data");
115
- return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application is missing for current license type data").build();
115
+ return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application is missing for current license type data").build();
116116 }
117117
118118 lt.setApplication(app);
....@@ -135,14 +135,14 @@
135135 LicenseType currentlt = em.find(LicenseType.class, Integer.parseInt(ltid));
136136 if (currentlt == null) {
137137 log.error("LicenseType with id {} not found in DB", ltid);
138
- return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "License type not found with ID: " + ltid).build();
138
+ return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "License type not found with ID: " + ltid).build();
139139 }
140140 Application app = null;
141141 if (lt.getApplicationId() != null) {
142142 app = em.find(Application.class, lt.getApplicationId());
143143 if (app == null) {
144144 log.error("LicenseType application with id {} not found in DB", lt.getApplicationId());
145
- return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "License type's app not found with ID: " + lt.getApplicationId()).build();
145
+ return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "License type's app not found with ID: " + lt.getApplicationId()).build();
146146 }
147147 }
148148 currentlt.setCode(lt.getCode());