Skip to content

Commit

Permalink
better error message on IO failure
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Aug 1, 2024
1 parent 5130653 commit 93a3036
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/IO.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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), _, _) ->
Expand Down

0 comments on commit 93a3036

Please sign in to comment.