Sha256: 8d4ffc03bd3c28d0bbb310c1351f66aedbe5de00f82d2771f0a8b36448fe8e2d

Contents?: true

Size: 865 Bytes

Versions: 6

Compression:

Stored size: 865 Bytes

Contents

module DIY
  class Error < RuntimeError; end
  # 数据包读取完毕
  class EOFError < Error; end
  
  # 期望报文等待超时
  class HopePacketTimeoutError < Error; end
  
  # 没有报文被指定时
  class ZeroOfflineError < Error; end
  
  class UserError < Error
    def initialize(real_exception)
      @real_exception = real_exception
      @name = real_exception.class
      @message = real_exception.message
      set_backtrace( Utils.filter_backtrace(real_exception) )
    end
    
    def inspect
      "#<#{self.class.name}: @real_exception=#{@name}, @real_msg=#{@message}>"
    end
  end
  
    # 不可能出现的报文出现
  class UnExpectPacketError < UserError; end
  
  # 策略执行异常
  class StrategyCallError < UserError; end
  # before_send 异常
  class BeforeSendCallError < UserError; end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
DIY-pcap-0.3.5 lib/diy/exceptions.rb
DIY-pcap-0.3.4 lib/diy/exceptions.rb
DIY-pcap-0.3.3 lib/diy/exceptions.rb
DIY-pcap-0.3.2 lib/diy/exceptions.rb
DIY-pcap-0.3.1 lib/diy/exceptions.rb
DIY-pcap-0.3.0 lib/diy/exceptions.rb