Example #1
0
func errget(err error) error {
	errno, ok := err.(syscall.Errno)
	if ok && errno >= C.ZMQ_HAUSNUMERO {
		return errors.New(C.GoString(C.zmq_strerror(C.int(errno))))
	}
	return err
}
Example #2
0
func zmqerr() error {
	eno := C.my_errno()
	switch eno {
	case C.ETERM:
		return ErrTerminated
	case C.EAGAIN:
		return ErrTimeout
	case C.EINTR:
		return ErrInterrupted
	}
	str := C.GoString(C.zmq_strerror(eno))
	return errors.New(str)
}
Example #3
0
File: zmq4.go Project: gallir/zmq4
// Get 0MQ error message string.
func Error(e int) string {
	return C.GoString(C.zmq_strerror(C.int(e)))
}
Example #4
0
File: zmq.go Project: quenel/gozmq
func (e zmqErrno) Error() string {
	return C.GoString(C.zmq_strerror(C.int(e)))
}
Example #5
0
// Return Errno as string.
func (errno Errno) Error() string {
	if errno >= C.ZMQ_HAUSNUMERO {
		return C.GoString(C.zmq_strerror(C.int(errno)))
	}
	return syscall.Errno(errno).Error()
}
Example #6
0
// Convert a 0mq error into a string
func (this ZError) String() string {
	return C.GoString(C.zmq_strerror(this.n))
}
Example #7
0
File: zmq.go Project: miffa/gozero
func (p LibZmqErrno) String() string {
	return C.GoString(C.zmq_strerror(C.int(p)))
}