Exception: AMQ::Protocol::Error
- Inherits:
-
StandardError
- Object
- StandardError
- AMQ::Protocol::Error
- Defined in:
- lib/amq/protocol/client.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.[]
62 63 64 |
# File 'lib/amq/protocol/client.rb', line 62 def initialize( = self.class::DEFAULT_MESSAGE) super() end |
Class Method Details
.[](code) ⇒ Object
self.subclasses_with_values
54 55 56 57 58 59 60 |
# File 'lib/amq/protocol/client.rb', line 54 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
45 46 47 48 |
# File 'lib/amq/protocol/client.rb', line 45 def self.inherited(subclass) @_subclasses ||= [] @_subclasses << subclass end |
.subclasses_with_values ⇒ Object
self.inherited(subclazz)
50 51 52 |
# File 'lib/amq/protocol/client.rb', line 50 def self.subclasses_with_values @_subclasses.select{ |k| defined?(k::VALUE) } end |