add: Exception Error响应的例子
diff --git a/samples/foo/src/main/resources/application.yaml b/samples/foo/src/main/resources/application.yaml
index 4943342..2dfd7aa 100644
--- a/samples/foo/src/main/resources/application.yaml
+++ b/samples/foo/src/main/resources/application.yaml
@@ -5,5 +5,16 @@
infras:
mvc:
custom-error:
+ enabled: true
error-map:
- com.supwisdom.leaveschool.foo.model.BarException: Bar Reason
+ org.springframework.validation.BindException: Customized Bind Error Reason
+ include-message: true
+ include-errors: true
+ include-error: true
+ include-exception: true
+ include-path: true
+ include-timestamp: true
+ include-status: true
+logging:
+ level:
+ org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod: trace
diff --git a/samples/foo/src/main/resources/templates/error.html b/samples/foo/src/main/resources/templates/error.html
new file mode 100644
index 0000000..a136738
--- /dev/null
+++ b/samples/foo/src/main/resources/templates/error.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+ <title>Customized Error Page</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+<body>
+<p>Error: <span th:text="${error}"></span></p>
+<p>Status: <span th:text="${status}"></span></p>
+<p>Message: <span th:text="${message}"></span></p>
+<p>Errors: <span th:text="${errors}"></span></p>
+<p>Exception: <span th:text="${exception}"></span></p>
+<p>Timestamp: <span th:text="${timestamp}"></span></p>
+<p>Path: <span th:text="${path}"></span></p>
+</body>
+</html>