(** Branded error pages. These pages expose no domain or service detail. *) open Dream_html open Page_kit open Page_shell let problem ~title ~detail = html_page title [ tag "p" [ class_ "eyebrow" ] [ txt "Attention required" ]; tag "h1" [] [ txt "%s" title ]; tag "p" [ class_ "warn" ] [ txt "%s" detail ]; ] let error_page ?viewer ?request ~status () = let title, detail = match status with | 404 -> ("Page not found", "That page does not exist. Use the navigation below.") | 400 -> ("Bad request", "That request could not be understood.") | 403 -> ("Forbidden", "You do not have access to that page.") | s when s >= 500 -> ("Something went wrong", "The server hit a problem. Try again shortly.") | _ -> ("Something went wrong", "That request could not be completed.") in html_page ?viewer ?request ~show_nav:true title [ tag "p" [ class_ "eyebrow" ] [ txt "%d" status ]; tag "h1" [] [ txt "%s" title ]; tag "p" [ class_ "warn" ] [ txt "%s" detail ]; ]