clean code
This commit is contained in:
parent
eda6a2d001
commit
1736a4c905
10 changed files with 46 additions and 27 deletions
|
|
@ -20,16 +20,3 @@ let render ~title ~scripts content =
|
|||
let err (status, msg) =
|
||||
let code = Dream.status_to_int status in
|
||||
Dream.html ~code @@ generic ~page_title:"Error" ~scripts:[] (Html.txt msg)
|
||||
|
||||
let error _error _debug_info suggested_response =
|
||||
let status = Dream.status suggested_response in
|
||||
let code = Dream.status_to_int status in
|
||||
let reason = Dream.status_to_string status in
|
||||
|
||||
Dream.set_header suggested_response "Content-Type" Dream.text_html;
|
||||
|
||||
let content = Html.txt @@ Format.sprintf "%d: %s" code reason in
|
||||
let body = generic ~page_title:"Error" ~scripts:[] content in
|
||||
|
||||
Dream.set_body suggested_response body;
|
||||
Lwt.return suggested_response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue