]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.auditlogging/src/org/simantics/audit/server/AuditLoggingAPI.java
AuditLogging improvements for easier unit testing
[simantics/platform.git] / bundles / org.simantics.auditlogging / src / org / simantics / audit / server / AuditLoggingAPI.java
index 980ea4c982751608d8deeeb3283b50b601b37926..c5eccfad93e843ed941f3b2bc6e24051e9d4b541 100644 (file)
@@ -59,4 +59,17 @@ public class AuditLoggingAPI {
             return Response.serverError().entity(buildJSONResponse("message", e.getMessage())).build();
         }
     }
+
+    @Path("{uuid}/error")
+    @POST
+    public Response error(@PathParam("uuid") String uuid, Map<String, Object> payload) {
+        
+        try {
+            AuditLogging.error(uuid, payload);
+            return Response.ok().build();
+        } catch (AuditLoggingException e) {
+            LOGGER.error("Could not log error audit with id {}", uuid, e);
+            return Response.serverError().entity(buildJSONResponse("message", e.getMessage())).build();
+        }
+    }
 }