| .. | .. |
|---|
| 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 | 27 | import net.curisit.securis.db.Application; |
|---|
| 27 | 28 | import net.curisit.securis.utils.TokenHelper; |
|---|
| 28 | 29 | |
|---|
| .. | .. |
|---|
| 87 | 88 | Application app = em.find(Application.class, Integer.parseInt(appid)); |
|---|
| 88 | 89 | if (app == null) { |
|---|
| 89 | 90 | log.error("Application with id {} not found in DB", appid); |
|---|
| 90 | | - return Response.status(Status.NOT_FOUND).build(); |
|---|
| 91 | + return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 91 | 92 | } |
|---|
| 92 | 93 | return Response.ok(app).build(); |
|---|
| 93 | 94 | } |
|---|
| .. | .. |
|---|
| 120 | 121 | Application currentapp = em.find(Application.class, Integer.parseInt(appid)); |
|---|
| 121 | 122 | if (currentapp == null) { |
|---|
| 122 | 123 | log.error("Application with id {} not found in DB", appid); |
|---|
| 123 | | - return Response.status(Status.NOT_FOUND).build(); |
|---|
| 124 | + return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 124 | 125 | } |
|---|
| 125 | 126 | currentapp.setName(app.getName()); |
|---|
| 126 | 127 | currentapp.setDescription(app.getDescription()); |
|---|
| .. | .. |
|---|
| 140 | 141 | Application app = em.find(Application.class, Integer.parseInt(appid)); |
|---|
| 141 | 142 | if (app == null) { |
|---|
| 142 | 143 | log.error("Application with id {} can not be deleted, It was not found in DB", appid); |
|---|
| 143 | | - return Response.status(Status.NOT_FOUND).build(); |
|---|
| 144 | + return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 144 | 145 | } |
|---|
| 145 | 146 | |
|---|
| 146 | 147 | em.remove(app); |
|---|