Module: ZMQ
- Defined in:
- lib/0mq.rb,
lib/0mq/poll.rb,
lib/0mq/curve.rb,
lib/0mq/proxy.rb,
lib/0mq/socket.rb,
lib/0mq/context.rb,
lib/0mq/version.rb,
lib/0mq/error_check.rb,
lib/0mq/socket/options.rb,
lib/0mq/poll_interruptible.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Context, Curve, Poll, PollInterruptible, Proxy, Socket, Version
Constant Summary collapse
Class Method Summary collapse
-
.error_check(adjust_backtrace = false) ⇒ Object
Checks the libzmq global error number and raises it as an exception.
-
.version ⇒ Object
Returns a ZMQ::Version object containing the libzmq library version.
Class Method Details
.error_check(adjust_backtrace = false) ⇒ Object
Checks the libzmq global error number and raises it as an exception. Should be used after calling a libzmq resource that returns -1 on error. Example: ZMQ.error_check if rc == -1
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/0mq/error_check.rb', line 44 def self.error_check(adjust_backtrace=false) errno = LibZMQ.zmq_errno backtrace = adjust_backtrace ? caller[0...-2] : caller if @error_map.has_key? errno raise @error_map[errno], '', backtrace else raise SystemCallError, errno.to_s, backtrace end end |