Sha256: ff636cc9a0cec84bd21d873866da4049b4f99c42cc508a7dccc91611cf43b84f

Contents?: true

Size: 1.21 KB

Versions: 13

Compression:

Stored size: 1.21 KB

Contents

module ZMQ

  class ZeroMQError < StandardError
    attr_reader :source, :result_code, :error_code, :message

    def initialize source, result_code, error_code, message
      @source = source
      @result_code = result_code
      @error_code = error_code
      @message = "msg [#{message}], error code [#{error_code}], rc [#{result_code}]"
      super message
    end
  end # call ZeroMQError


  class ContextError < ZeroMQError
    # True when the exception was raised due to the library
    # returning EINVAL.
    #
    # Occurs when he number of app_threads requested is less
    # than one, or the number of io_threads requested is
    # negative.
    #
    def einval?() EINVAL == @error_code; end

    # True when the exception was raised due to the library
    # returning ETERM.
    #
    # The associated context was terminated.
    #
    def eterm?() ETERM == @error_code; end

  end # class ContextError


  class MessageError < ZeroMQError
    # True when the exception was raised due to the library
    # returning ENOMEM.
    #
    # Only ever raised by the #Message class when it fails
    # to allocate sufficient memory to send a message.
    #
    def enomem?() ENOMEM == @error_code; end
  end

end # module ZMQ

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
ffi-rzmq-2.0.0 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-1.0.3 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-1.0.2 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-1.0.1 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-1.0.0 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-0.9.7 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-0.9.6 lib/ffi-rzmq/exceptions.rb
ffi-rxs-1.1.0 lib/ffi-rxs/exceptions.rb~
ffi-rxs-1.0.1 lib/ffi-rxs/exceptions.rb~
ffi-rxs-1.0.0 lib/ffi-rxs/exceptions.rb~
ffi-rzmq-0.9.3 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-0.9.2 lib/ffi-rzmq/exceptions.rb
ffi-rzmq-0.9.0 lib/ffi-rzmq/exceptions.rb