Skip to content

Commit

Permalink
Merge pull request #229 from codeine-cd/codeine-228
Browse files Browse the repository at this point in the history
codeine-228 return 404 on project not found
  • Loading branch information
lchayoun authored Mar 14, 2018
2 parents b71977b + dc48b1d commit 08bf40d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/codeine/servlet/AbstractServlet.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package codeine.servlet;

import codeine.utils.exceptions.ProjectNotFoundException;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 08bf40d

Please sign in to comment.