Skip to content

Commit 493447d

Browse files
ahornaceVladimir Kotal
authored andcommitted
Add comment and change log level
1 parent 085e770 commit 493447d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/org/opensolaris/opengrok/web/api/error/ExceptionMapperUtils.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public class ExceptionMapperUtils {
3030
private ExceptionMapperUtils() {
3131
}
3232

33+
/**
34+
* Turns the exception into JSON format and embeds it into the response with the provided status.
35+
* @param status status of the created response
36+
* @param e exception to embed into the response
37+
* @return response with the {@code status} and JSON media type with encoded {@code e} in the body
38+
*/
3339
public static Response toResponse(final Response.Status status, final Exception e) {
3440
return Response.status(status)
3541
.entity(new ExceptionModel(e.getMessage()))
@@ -41,7 +47,7 @@ private static class ExceptionModel {
4147

4248
private String message;
4349

44-
public ExceptionModel(final String message) {
50+
ExceptionModel(final String message) {
4551
this.message = message;
4652
}
4753

src/org/opensolaris/opengrok/web/api/error/GenericExceptionMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class GenericExceptionMapper implements ExceptionMapper<Exception> {
3737

3838
@Override
3939
public Response toResponse(final Exception e) {
40-
logger.log(Level.FINE, "Exception while processing request", e);
40+
logger.log(Level.WARNING, "Exception while processing request", e);
4141

4242
return ExceptionMapperUtils.toResponse(Response.Status.INTERNAL_SERVER_ERROR, e);
4343
}

0 commit comments

Comments
 (0)