diff --git a/src/common/codeine/servlet/AbstractServlet.java b/src/common/codeine/servlet/AbstractServlet.java index 4c4426e9..671609dc 100755 --- a/src/common/codeine/servlet/AbstractServlet.java +++ b/src/common/codeine/servlet/AbstractServlet.java @@ -1,5 +1,6 @@ package codeine.servlet; +import codeine.utils.exceptions.ProjectNotFoundException; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; @@ -123,6 +124,9 @@ protected void handleError(Exception e, HttpServletResponse response) { } else if (e instanceof InShutdownException){ error = new ApiError("Cannot execute","Preparing for shutdown",e.getMessage()); response.setStatus(HttpStatus.FORBIDDEN_403); + } else if (e instanceof ProjectNotFoundException){ + error = new ApiError("Not found",e.getMessage(),e.getMessage()); + response.setStatus(HttpStatus.NOT_FOUND_404); } else { error = new ApiError("Internal Server Error",e.getMessage() ,e.getMessage()); response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);