> In src/fail.c:
>
> > @@ -54,10 +55,14 @@ void caml_zmq_raise(int err_no, const char *err_str) {
> >          }
> >      }
> >
> > -    error_parameters[0] = Val_int(error_to_raise);
> > -    error_parameters[1] = caml_copy_string(err_str);
> > -    caml_raise_with_args(*caml_named_value("ZMQ.ZMQ_exception"),
> > -                         2, error_parameters);
> > +    if (error_to_raise == caml_zmq_EUNKNOWN) {
>
> I think this check should be replaced with error_to_raise >=
> ZMQ_HAUSNUMERO (ref<https://github.com/zeromq/libzmq/blob/master/include/zmq.h#L97>
> ).
>
>

I think the change would be

```
  if (err_no < ZMQ_HAUSNUMERO) {
```

This would map the most error codes directly to Unix_error exceptions.

On the other hand you would end up with 2 possible exceptions for some
error codes and which occurred would depend on the platform.  This doesn't
seem very nice to me.

Ideally you would perform a further mapping back to the Unix error codes
but I dont think you can do that either due to the way they are defined in
`unixsupport.c` (all undefined codes map to -1).