Skip to content

Commit

Permalink
feat: add RouteDetails.EMPTY when failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Unsaved2 committed Dec 14, 2024
1 parent 994c23b commit ba93235
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ class DirectionsViewModel(private val repository: DirectionsRepositoryInterface)
targetStateFlow.value = routeDetails
} else {
Log.e("DirectionsViewModel", "Failed to extract route details")
targetStateFlow.value = RouteDetails.EMPTY
}
},
onFailure = { exception ->
Log.e("DirectionsViewModel", "Failed to fetch directions", exception)
targetStateFlow.value = RouteDetails.EMPTY
})
}
}
Expand Down

0 comments on commit ba93235

Please sign in to comment.