Class: Ably::Realtime::Connection::ConnectionStateMachine

Inherits:
Object
  • Object
show all
Includes:
Modules::StateMachine
Defined in:
lib/ably/realtime/connection/connection_state_machine.rb

Overview

Internal class to manage connection state, recovery and state transitions for Ably::Realtime::Connection

Class Method Summary collapse

Methods included from Modules::StateMachine

#exception_for_state_change_to, included, #previous_state, #previous_transition, #transition_state

Class Method Details

.error_from_state_change(current_transition) ⇒ Object



126
127
128
129
130
131
132
# File 'lib/ably/realtime/connection/connection_state_machine.rb', line 126

def self.error_from_state_change(current_transition)
  # ConnectionStateChange object is always passed in current_transition metadata object
  connection_state_change = current_transition.
  # Reason attribute contains errors
  err = connection_state_change && connection_state_change.reason
  err if is_error_type?(err)
end