Skip to content

Commit

Permalink
MPExceptionUtil: Log http 403 Forbidden, 404 NotFound, at WARN level …
Browse files Browse the repository at this point in the history
…without stack

When a request results in an HTTP 403 Forbidden or 404 NotFound, it's logged at an Error level and emits a full stack trace.
That's not necessary and this patch changes it to a warning without the full stack trace.
  • Loading branch information
ljdelight committed Nov 23, 2023
1 parent e612be2 commit e63aa3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/org/maproulette/exception/MPExceptionUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ object MPExceptionUtil {
logger.debug(e.getMessage)
Unauthorized(Json.toJson(StatusMessage("NotAuthorized", JsString(e.getMessage)))).withNewSession
case e: IllegalAccessException =>
logger.error(e.getMessage, e)
logger.warn(e.getMessage)
Forbidden(Json.toJson(StatusMessage("Forbidden", JsString(e.getMessage))))
case e: NotFoundException =>
logger.error(e.getMessage, e)
logger.warn(e.getMessage)
NotFound(Json.toJson(StatusMessage("NotFound", JsString(e.getMessage))))
case e: ChangeConflictException =>
logger.error(e.getMessage, e)
Expand Down

0 comments on commit e63aa3f

Please sign in to comment.