Exception: EventState::ProtocolError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- EventState::ProtocolError
- Defined in:
- lib/event_state.rb
Overview
Base class for SendProtocolError and RecvProtocolError.
You can catch these errors by registering a block with EventMachine.error_handler
.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action ⇒ :recv, :send
readonly
Whether the error occurred on a send or a receive.
-
#data ⇒ Object
readonly
The message / data sent or received.
-
#machine ⇒ Machine
readonly
The machine that raised the error.
-
#message_name ⇒ Object
readonly
The name of the message sent or received.
-
#state_name ⇒ Symbol
readonly
The name of the state in which the error occurred.
Instance Method Summary collapse
-
#initialize(machine, state_name, action, message_name, data) ⇒ ProtocolError
constructor
A new instance of ProtocolError.
- #inspect ⇒ String
Constructor Details
#initialize(machine, state_name, action, message_name, data) ⇒ ProtocolError
Returns a new instance of ProtocolError.
20 21 22 23 |
# File 'lib/event_state.rb', line 20 def initialize machine, state_name, action, , data @machine, @state_name, @action, @message_name, @data = machine, state_name, action, , data end |
Instance Attribute Details
#action ⇒ :recv, :send (readonly)
Returns whether the error occurred on a send or a receive.
38 39 40 |
# File 'lib/event_state.rb', line 38 def action @action end |
#data ⇒ Object (readonly)
Returns the message / data sent or received.
48 49 50 |
# File 'lib/event_state.rb', line 48 def data @data end |
#machine ⇒ Machine (readonly)
Returns the machine that raised the error.
28 29 30 |
# File 'lib/event_state.rb', line 28 def machine @machine end |
#message_name ⇒ Object (readonly)
Returns the name of the message sent or received.
43 44 45 |
# File 'lib/event_state.rb', line 43 def @message_name end |
#state_name ⇒ Symbol (readonly)
Returns the name of the state in which the error occurred.
33 34 35 |
# File 'lib/event_state.rb', line 33 def state_name @state_name end |
Instance Method Details
#inspect ⇒ String
53 54 55 56 |
# File 'lib/event_state.rb', line 53 def inspect "#<#{self.class}: for #{machine.class} in"\ " #{state_name.inspect} state: #{action} #{}>" end |