mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
better error message on IO failure
This commit is contained in:
parent
5130653068
commit
93a30366e1
1 changed files with 6 additions and 4 deletions
|
|
@ -32,11 +32,13 @@ module Output = struct
|
|||
len := !len - n
|
||||
| exception
|
||||
Unix.Unix_error
|
||||
( ( Unix.EBADF | Unix.ENOTCONN | Unix.ESHUTDOWN
|
||||
| Unix.ECONNRESET | Unix.EPIPE ),
|
||||
_,
|
||||
( (( Unix.EBADF | Unix.ENOTCONN | Unix.ESHUTDOWN
|
||||
| Unix.ECONNRESET | Unix.EPIPE ) as err),
|
||||
fn,
|
||||
_ ) ->
|
||||
failwith "write failed"
|
||||
failwith
|
||||
@@ Printf.sprintf "write failed in %s: %s" fn
|
||||
(Unix.error_message err)
|
||||
| exception
|
||||
Unix.Unix_error
|
||||
((Unix.EWOULDBLOCK | Unix.EAGAIN | Unix.EINTR), _, _) ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue