# File lib/stomp/client.rb, line 108 def create_error_handler client_thread = Thread.current @error_listener = lambda do |error| exception = case error.body when /ResourceAllocationException/i Stomp::Error::ProducerFlowControlException.new(error) when /ProtocolException/i Stomp::Error::ProtocolException.new(error) else Stomp::Error::BrokerException.new(error) end @receipt_listeners.delete(error.headers['receipt-id']) if error.headers['receipt-id'] client_thread.raise exception end end