Exception: AMQ::Protocol::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/amq/protocol/exceptions.rb

Direct Known Subclasses

BadResponseError, EmptyResponseError, FrameTypeError, HardError, SoftError

Constant Summary

DEFAULT_MESSAGE =
"AMQP error".freeze

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Error) initialize(message = self.class::DEFAULT_MESSAGE)

self.[]



23
24
25
# File 'lib/amq/protocol/exceptions.rb', line 23

def initialize(message = self.class::DEFAULT_MESSAGE)
  super(message)
end

Class Method Details

+ (Object) [](code)

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

+ (Object) inherited(subclass)



6
7
8
9
# File 'lib/amq/protocol/exceptions.rb', line 6

def self.inherited(subclass)
  @_subclasses ||= []
  @_subclasses << subclass
end

+ (Object) subclasses_with_values

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