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
|
len := !len - n
|
||||||
| exception
|
| exception
|
||||||
Unix.Unix_error
|
Unix.Unix_error
|
||||||
( ( Unix.EBADF | Unix.ENOTCONN | Unix.ESHUTDOWN
|
( (( Unix.EBADF | Unix.ENOTCONN | Unix.ESHUTDOWN
|
||||||
| Unix.ECONNRESET | Unix.EPIPE ),
|
| Unix.ECONNRESET | Unix.EPIPE ) as err),
|
||||||
_,
|
fn,
|
||||||
_ ) ->
|
_ ) ->
|
||||||
failwith "write failed"
|
failwith
|
||||||
|
@@ Printf.sprintf "write failed in %s: %s" fn
|
||||||
|
(Unix.error_message err)
|
||||||
| exception
|
| exception
|
||||||
Unix.Unix_error
|
Unix.Unix_error
|
||||||
((Unix.EWOULDBLOCK | Unix.EAGAIN | Unix.EINTR), _, _) ->
|
((Unix.EWOULDBLOCK | Unix.EAGAIN | Unix.EINTR), _, _) ->
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue