Custom Error Page
SØAD allows you to configure custom error pages for standard HTTP errors such as 404 (Not Found) or 500 (Internal Server Error).
How to Configure Custom Error Pages
You can define them in the sufia.properties file like this:
You can either link to a static HTML file or to a transaction. For example, the configuration error.page.403 = /t/page/err403 will invoke the transaction at /t/page/err403, allowing you to render a dynamic error view from Python logic and Handlebars.
These paths should point to static HTML files that reside under the /webapp/ directory.
Example: 404.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Not Found</title>
<style>
body { font-family: sans-serif; text-align: center; padding: 5em; }
h1 { font-size: 3em; color: #cc0000; }
</style>
</head>
<body>
<h1>404 - Page Not Found</h1>
<p>Sorry, the page you're looking for doesn't exist.</p>
<a href="/">Back to Home</a>
</body>
</html>
Example: 500.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Server Error</title>
<style>
body { font-family: sans-serif; text-align: center; padding: 5em; }
h1 { font-size: 3em; color: #cc0000; }
</style>
</head>
<body>
<h1>500 - Internal Server Error</h1>
<p>Something went wrong on the server.</p>
<a href="/">Try Again</a>
</body>
</html>
These custom pages enhance user experience and provide better error handling for production environments.