| .. | .. |
|---|
| 23 | 23 | import javax.ws.rs.core.Response.Status; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | import net.curisit.integrity.commons.Utils; |
|---|
| 26 | | -import net.curisit.securis.SecurisErrorHandler; |
|---|
| 26 | +import net.curisit.securis.DefaultExceptionHandler; |
|---|
| 27 | 27 | import net.curisit.securis.db.Application; |
|---|
| 28 | 28 | import net.curisit.securis.db.LicenseType; |
|---|
| 29 | 29 | import net.curisit.securis.utils.TokenHelper; |
|---|
| .. | .. |
|---|
| 108 | 108 | app = em.find(Application.class, lt.getApplicationId()); |
|---|
| 109 | 109 | if (app == null) { |
|---|
| 110 | 110 | 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(); |
|---|
| 112 | 112 | } |
|---|
| 113 | 113 | } else { |
|---|
| 114 | 114 | 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(); |
|---|
| 116 | 116 | } |
|---|
| 117 | 117 | |
|---|
| 118 | 118 | lt.setApplication(app); |
|---|
| .. | .. |
|---|
| 135 | 135 | LicenseType currentlt = em.find(LicenseType.class, Integer.parseInt(ltid)); |
|---|
| 136 | 136 | if (currentlt == null) { |
|---|
| 137 | 137 | 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(); |
|---|
| 139 | 139 | } |
|---|
| 140 | 140 | Application app = null; |
|---|
| 141 | 141 | if (lt.getApplicationId() != null) { |
|---|
| 142 | 142 | app = em.find(Application.class, lt.getApplicationId()); |
|---|
| 143 | 143 | if (app == null) { |
|---|
| 144 | 144 | 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(); |
|---|
| 146 | 146 | } |
|---|
| 147 | 147 | } |
|---|
| 148 | 148 | currentlt.setCode(lt.getCode()); |
|---|