Customized the error-pages by adding a template master unit-vs-integration
authorKai Moritz <kai@juplo.de>
Fri, 28 Aug 2020 09:14:25 +0000 (11:14 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 28 Aug 2020 09:14:25 +0000 (11:14 +0200)
src/main/resources/templates/error/error.html [new file with mode: 0644]

diff --git a/src/main/resources/templates/error/error.html b/src/main/resources/templates/error/error.html
new file mode 100644 (file)
index 0000000..63ee50b
--- /dev/null
@@ -0,0 +1,60 @@
+<!doctype html>
+<html xmlns:th="http://www.thymeleaf.org" lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <title>Shows Remote-Content</title>
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
+  </head>
+  <body>
+    <nav class="navbar navbar-dark bg-primary navbar-expand navbar-dark flex-column">
+      <h2 class="navbar-brand">Demo: Unit-Test or Integration-Test &mdash; A Practical Guide</h2>
+    </nav>
+    <main class="container mt-5">
+      <div class="card">
+        <div class="card-header" id="content"><h1 th:text="|${status}: ${error}">XXX: ERROR</h1></div>
+        <div class="card-body">
+          <table class="card-text table">
+            <tbody>
+              <tr class="border-top-0">
+                <th scope="row">Status</th>
+                <td th:text="${status}">ERROR.STATUS</td>
+              </tr>
+              <tr>
+                <th scope="row">Error</th>
+                <td th:text="${error}">ERROR.ERROR</td>
+              </tr>
+              <tr th:if="!${#strings.isEmpty(message)}">
+                <th scope="row">Message</th>
+                <td th:text="${message}">ERROR.MESSAGE</td>
+              </tr>
+              <tr th:if="!${#strings.isEmpty(requestId)}">
+                <th class="text-nowrap" scope="row">Request-ID</th>
+                <td th:text="${requestId}">ERROR.REQUEST_ID</td>
+              </tr>
+              <tr>
+                <th scope="row">Timstamp</th>
+                <td th:text="${timestamp}">ERROR.TIMESTAMP</td>
+              </tr>
+              <tr th:if="!${#strings.isEmpty(path)}">
+                <th scope="row">Path</th>
+                <td th:text="${path}">ERROR.PATH</td>
+              </tr>
+              <!--/**-->
+              <tr th:if="!${#strings.isEmpty(trace)}">
+                <th scope="row">Trace</th>
+                <td>
+                  <div class="overflow-hidden">
+                    <pre class="overflow-hidden" th:text="${trace}">ERROR.TRACE</pre>
+                  </div>
+                </td>
+              </tr>
+              <!--**/-->
+            </tbody>
+          </table>
+          <a href="#" th:href="@{/}" class="btn btn-primary">Back to HOME</a>
+        </div>
+      </div>
+    </main>
+  </body>
+</html>