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


122
123
124
125
126
127
128
# File 'lib/ably/realtime/connection/connection_state_machine.rb', line 122

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