Sha256: ad292cb35f41fce73d799528c466ada59337a6378daadd78ec170d764cecd03a
Contents?: true
Size: 700 Bytes
Versions: 5
Compression:
Stored size: 700 Bytes
Contents
module ZMQ # A hash of error number => exception class. # Example: 1 => Errno::EPERM ErrorMap = Hash.new Errno.constants .map { |x| Errno.const_get x } .select { |x| x.is_a?(Class) && x < SystemCallError } .each { |x| ErrorMap[x.const_get(:Errno)] = x } # 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 def self.error_check(adjust_backtrace=false) errno = LibZMQ.zmq_errno return true if errno == 25 # TODO: Use adjust_backtrace str = '' raise ErrorMap[errno], str, caller[0...-2] end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
0mq-0.5.1 | lib/0mq/error_map.rb |
0mq-0.5.0 | lib/0mq/error_map.rb |
0mq-0.4.1 | lib/0mq/error_map.rb |
0mq-0.4.0 | lib/0mq/error_map.rb |
0mq-0.3.0 | lib/0mq/error_map.rb |