mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
better error messages
This commit is contained in:
parent
14a48756a8
commit
e8c7d3c879
1 changed files with 4 additions and 3 deletions
|
|
@ -126,10 +126,11 @@ let parse_req_start ~client_addr ~get_time_s ~buf (bs : IO.Input.t) :
|
||||||
meth, path, version
|
meth, path, version
|
||||||
with
|
with
|
||||||
| Invalid_argument msg ->
|
| Invalid_argument msg ->
|
||||||
Log.error (fun k -> k "invalid request line: `%s`: %s" line msg);
|
Log.error (fun k -> k "invalid request line: %S: %s" line msg);
|
||||||
raise (Bad_req (400, "Invalid request line"))
|
raise (Bad_req (400, "Invalid request line"))
|
||||||
| _ ->
|
| exn ->
|
||||||
Log.error (fun k -> k "invalid request line: `%s`" line);
|
Log.error (fun k ->
|
||||||
|
k "invalid request line: %S: %s" line (Printexc.to_string exn));
|
||||||
raise (Bad_req (400, "Invalid request line"))
|
raise (Bad_req (400, "Invalid request line"))
|
||||||
in
|
in
|
||||||
let meth = Meth.of_string meth in
|
let meth = Meth.of_string meth in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue