Exception: AMQ::Protocol::Error
- Inherits:
-
StandardError
- Object
- StandardError
- AMQ::Protocol::Error
- Defined in:
- lib/amq/protocol/exceptions.rb
Direct Known Subclasses
BadResponseError, EmptyResponseError, FrameTypeError, HardError, SoftError
Constant Summary collapse
- DEFAULT_MESSAGE =
"AMQP error".freeze
Class Method Summary collapse
-
.[](code) ⇒ Object
self.subclasses_with_values.
- .inherited(subclass) ⇒ Object
-
.subclasses_with_values ⇒ Object
self.inherited(subclazz).
Instance Method Summary collapse
-
#initialize(message = self.class::DEFAULT_MESSAGE) ⇒ Error
constructor
self.[].
Constructor Details
#initialize(message = self.class::DEFAULT_MESSAGE) ⇒ Error
self.[]
23 24 25 |
# File 'lib/amq/protocol/exceptions.rb', line 23 def initialize( = self.class::DEFAULT_MESSAGE) super() end |
Class Method Details
.[](code) ⇒ Object
self.subclasses_with_values
15 16 17 18 19 20 21 |
# File 'lib/amq/protocol/exceptions.rb', line 15 def self.[](code) if result = subclasses_with_values.detect { |klass| klass::VALUE == code } result else raise "No such exception class for code #{code}" unless result end # if end |
.inherited(subclass) ⇒ Object
6 7 8 9 |
# File 'lib/amq/protocol/exceptions.rb', line 6 def self.inherited(subclass) @_subclasses ||= [] @_subclasses << subclass end |
.subclasses_with_values ⇒ Object
self.inherited(subclazz)
11 12 13 |
# File 'lib/amq/protocol/exceptions.rb', line 11 def self.subclasses_with_values @_subclasses.select{ |k| defined?(k::VALUE) } end |