mirror of https://github.com/halo-dev/halo
Fix #186
parent
9849fe65cb
commit
3dc0a4ea39
|
@ -27,7 +27,7 @@ import java.util.Map;
|
||||||
*
|
*
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
*/
|
*/
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice({"run.halo.app.controller.admin.api", "run.halo.app.controller.content.api"})
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ControllerExceptionHandler {
|
public class ControllerExceptionHandler {
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,11 @@ public class CommonController implements ErrorController {
|
||||||
if (StringUtils.startsWithIgnoreCase(throwable.getMessage(), "Could not resolve view with name '")) {
|
if (StringUtils.startsWithIgnoreCase(throwable.getMessage(), "Could not resolve view with name '")) {
|
||||||
// TODO May cause unknown-reason problem
|
// TODO May cause unknown-reason problem
|
||||||
// if Ftl was not found then redirect to /404
|
// 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue