The canonical argument list for Unix_error is: errno, function name, argument that causes the error in form of string. Perhaps you could thread the function name in every code calling caml_zmq_raise? (I don't think there is any place which suggests passing a third argument to Unix_error in ocaml-zmq.)