mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-05 19:00:32 -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
|
||||
with
|
||||
| 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"))
|
||||
| _ ->
|
||||
Log.error (fun k -> k "invalid request line: `%s`" line);
|
||||
| exn ->
|
||||
Log.error (fun k ->
|
||||
k "invalid request line: %S: %s" line (Printexc.to_string exn));
|
||||
raise (Bad_req (400, "Invalid request line"))
|
||||
in
|
||||
let meth = Meth.of_string meth in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue