Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://baussprojects.comlu.com/projects.php#daweb
- import std.array : replace;
- string type = queryString.get("type", "UNKNOWN_ERROR_TYPE");
- string page = queryString.get("page", "");
- html = replace(html, "@ERROR_TITLE", type);
- switch (type) {
- case "404":
- html = replace(html, "@ERROR_TEXT", page ~ " was not found!");
- break;
- default:
- html = replace(html, "@ERROR_TEXT", page ~ " threw an unknown error type!");
- break;
- }
- <html>
- <head>
- <title>@ERROR_TITLE</title>
- </head>
- <body>
- <p>@ERROR_TEXT</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement