fixed bug

This commit is contained in:
Massimiliano Assante 2023-02-02 20:18:14 +01:00
parent bffac60eb1
commit 6066406a08
1 changed files with 3 additions and 1 deletions

View File

@ -179,7 +179,7 @@ public class Comments {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@StatusCodes ({
@ResponseCode ( code = 201, condition = "Successfull created, the new post is reported in the 'result' field of the returned object"),
@ResponseCode ( code = 201, condition = "Successfull created, the new comment is reported in the 'result' field of the returned object"),
@ResponseCode ( code = 500, condition = ErrorMessages.ERROR_IN_API_RESULT)
})
public Response writeComment(
@ -235,7 +235,9 @@ public class Comments {
try {
result = CassandraConnection.getInstance().getDatabookStore().addComment(theComment);
logger.debug("Added comment? " + comment.toString() + " Result is " +result);
} catch(Exception e){
e.printStackTrace();
responseBean.setMessage("Could not reach the DB to write the comment, something went wrong");
responseBean.setSuccess(false);
status = Status.INTERNAL_SERVER_ERROR;