Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNiang committed Jun 7, 2019
1 parent f08361c commit 8f1c696
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -27,7 +27,7 @@
*
* @author johnniang
*/
@RestControllerAdvice
@RestControllerAdvice({"run.halo.app.controller.admin.api", "run.halo.app.controller.content.api"})
@Slf4j
public class ControllerExceptionHandler {

Expand Down
Expand Up @@ -53,11 +53,11 @@ public String handleError(HttpServletRequest request) {
if (StringUtils.startsWithIgnoreCase(throwable.getMessage(), "Could not resolve view with name '")) {
// TODO May cause unknown-reason problem
// if Ftl was not found then redirect to /404
return "redirect:/404";
return contentNotFround();
}
}

return statusCode == 500 ? "redirect:/500" : "redirect:/404";
return statusCode == 500 ? contentInternalError() : contentNotFround();
}

/**
Expand Down

0 comments on commit 8f1c696

Please sign in to comment.