Exception: Bundesstrasse::ZMQError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bundesstrasse/errors.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, error_code = -1)) ⇒ ZMQError

Returns a new instance of ZMQError.



4
5
6
7
# File 'lib/bundesstrasse/errors.rb', line 4

def initialize(message, error_code=-1)
  @error_code = error_code
  super(message)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



3
4
5
# File 'lib/bundesstrasse/errors.rb', line 3

def error_code
  @error_code
end

Class Method Details

.raise_error(e) ⇒ Object



9
10
11
# File 'lib/bundesstrasse/errors.rb', line 9

def self.raise_error(e)
  raise new(e.message, e.error_code)
end