Advertisement
Guest User

error.d - BaussProjects - daweb

a guest
Dec 4th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.54 KB | None | 0 0
  1. // http://baussprojects.comlu.com/projects.php#daweb
  2. import std.array : replace;
  3.  
  4. string type = queryString.get("type", "UNKNOWN_ERROR_TYPE");
  5. string page = queryString.get("page", "");
  6.  
  7. html = replace(html, "@ERROR_TITLE", type);
  8.  
  9. switch (type) {
  10.     case "404":
  11.         html = replace(html, "@ERROR_TEXT", page ~ " was not found!");
  12.         break;
  13.  
  14.     default:
  15.         html = replace(html, "@ERROR_TEXT", page ~ " threw an unknown error type!");
  16.         break;
  17. }
  18. <html>
  19.  
  20. <head>
  21.     <title>@ERROR_TITLE</title>
  22. </head>
  23. <body>
  24.     <p>@ERROR_TEXT</p>
  25. </body>
  26.  
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement