Exception: RabbitMQ::ServerError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- RabbitMQ::ServerError
- Defined in:
- lib/rabbitmq/server_error.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ChannelError, ConnectionError
Class Attribute Summary collapse
-
.lookup_table ⇒ Object
readonly
Returns the value of attribute lookup_table.
Instance Attribute Summary collapse
-
#event ⇒ Object
writeonly
Sets the attribute event.
Class Method Summary collapse
Class Attribute Details
.lookup_table ⇒ Object (readonly)
Returns the value of attribute lookup_table.
5 6 7 |
# File 'lib/rabbitmq/server_error.rb', line 5 def lookup_table @lookup_table end |
Instance Attribute Details
#event=(value) ⇒ Object (writeonly)
Sets the attribute event
23 24 25 |
# File 'lib/rabbitmq/server_error.rb', line 23 def event=(value) @event = value end |
Class Method Details
.from(event) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rabbitmq/server_error.rb', line 8 def self.from(event) properties = event.fetch(:properties) kls = case event.fetch(:method) when :channel_close ChannelError.lookup_table[properties.fetch(:reply_code)] when :connection_close ConnectionError.lookup_table[properties.fetch(:reply_code)] else return end exc = kls.new(properties.fetch(:reply_text)) exc.event = event exc end |