Skip to content

Commit

Permalink
Retry w/ default params for screen when deserialize params for screen…
Browse files Browse the repository at this point in the history
… fails
  • Loading branch information
luca992 committed Sep 13, 2023
1 parent c5fd320 commit 5fdd9c0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class Navigation(val stateManager : StateManager) {
startScreenIdentifier = try {
ScreenIdentifier.getByURI(savedLevel1URI) ?: startScreenIdentifier
} catch (e: ScreenParamsDeserializationException) {
stateManager.dataRepository.localSettings.clear()
throw ScreenParamsDeserializationException(
"Failed to deserialize params for screen: ${startScreenIdentifier.screen.asString}. " +
"Local settings have been reset. Please restart the app.",
e
debugLogger.log(
"Warning: Failed to deserialize params for screen: ${startScreenIdentifier.screen.asString}. " +
"Retrying with default params for screen"
)
stateManager.dataRepository.localSettings.clear()
ScreenIdentifier.getByURI(savedLevel1URI)!!
}
}
return startScreenIdentifier
Expand Down

0 comments on commit 5fdd9c0

Please sign in to comment.