Sha256: 0bd4bb8dac9e976c8bbd2a57dea556dc55665f8f78198925cc27860ca99d6602

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

module ZMQ
  
  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 }
  
  def self.error_check(adjust_backtrace=false)
    errno = LibZMQ.zmq_errno
    return true if errno == 25
    
    # str = LibZMQ.zmq_strerror(errno).read_string
    str = ''
    raise ErrorMap[errno], str, caller[0...-2]
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
0mq-0.2.1 lib/0mq/error_map.rb
0mq-0.2.0 lib/0mq/error_map.rb
0mq-0.1.2 lib/0mq/error_map.rb
0mq-0.1.1 lib/0mq/error_map.rb
0mq-0.1.0 lib/0mq/error_map.rb