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.[]
69 70 71 |
# File 'lib/amq/protocol/client.rb', line 69 def initialize( = self.class::DEFAULT_MESSAGE) super() end |
Class Method Details
.[](code) ⇒ Object
self.subclasses_with_values
61 62 63 64 65 66 67 |
# File 'lib/amq/protocol/client.rb', line 61 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
52 53 54 55 |
# File 'lib/amq/protocol/client.rb', line 52 def self.inherited(subclass) @_subclasses ||= [] @_subclasses << subclass end |
.subclasses_with_values ⇒ Object
self.inherited(subclazz)
57 58 59 |
# File 'lib/amq/protocol/client.rb', line 57 def self.subclasses_with_values @_subclasses.select{ |k| defined?(k::VALUE) } end |