Be more lenient with fatalErrors coming out of equal transitions, caused by asynchronicity on the UI layer

This commit is contained in:
Stefan Ceriu
2023-09-01 13:35:27 +03:00
committed by Stefan Ceriu
parent d90d7adb21
commit 61326ed63a
3 changed files with 15 additions and 3 deletions
@@ -277,7 +277,11 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
}
stateMachine.addErrorHandler { context in
fatalError("Failed transition with context: \(context)")
if context.fromState == context.toState {
MXLog.error("Failed transition from equal states: \(context.fromState)")
} else {
fatalError("Failed transition with context: \(context)")
}
}
}
@@ -254,7 +254,11 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
}
stateMachine.addErrorHandler { context in
fatalError("Failed transition with context: \(context)")
if context.fromState == context.toState {
MXLog.error("Failed transition from equal states: \(context.fromState)")
} else {
fatalError("Failed transition with context: \(context)")
}
}
}
@@ -209,7 +209,11 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
}
stateMachine.addErrorHandler { context in
fatalError("Failed transition with context: \(context)")
if context.fromState == context.toState {
MXLog.error("Failed transition from equal states: \(context.fromState)")
} else {
fatalError("Failed transition with context: \(context)")
}
}
}