Add generic error page with stack trace
Add a @ControllerAdvice that catches all exceptions and renders an error page showing status, error type, message, and full stack trace in a <pre> block. Uses table-based layout consistent with the rest of the UI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>Error</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Error</h1>
|
||||
<table border="1" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td><b>Status</b></td>
|
||||
<td th:text="${status}">500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Error</b></td>
|
||||
<td th:text="${error}">Internal Server Error</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Message</b></td>
|
||||
<td th:text="${message}">Something went wrong</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Stack Trace</h2>
|
||||
<pre th:text="${trace}">No stack trace available.</pre>
|
||||
<br/>
|
||||
<a href="/" target="_top">Back to home</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user