Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ class ClientApiViewModel @Inject internal constructor(
val flowCompleted = isFlowCompletedWithError(errorResponse)
simpleEventReporter.addCompletionCheckEvent(flowCompleted = flowCompleted)
simpleEventReporter.closeCurrentSessionNormally()

deleteSessionEventsIfNeeded(currentSessionId)

_returnResponse.send(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ internal class OrchestratorFragment : Fragment(R.layout.fragment_orchestrator) {
observeOrchestratorVm()

handleResult<AlertResult>(AlertContract.DESTINATION) { alertResult ->
clientApiVm.handleErrorResponse(
args.requestAction,
orchestratorVm.handleErrorResponse(
AppErrorResponse(alertResult.appErrorReason ?: AppErrorReason.UNEXPECTED_ERROR)
)
}
Expand Down Expand Up @@ -151,8 +150,7 @@ internal class OrchestratorFragment : Fragment(R.layout.fragment_orchestrator) {
})

loginCheckVm.returnLoginNotComplete.observe(viewLifecycleOwner, LiveDataEventObserver {
clientApiVm.handleErrorResponse(
args.requestAction,
orchestratorVm.handleErrorResponse(
AppErrorResponse(AppErrorReason.LOGIN_NOT_COMPLETE)
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal class OrchestratorViewModel @Inject constructor(
try {
steps = stepsBuilder.build(action, projectConfiguration)
} catch (e: SubjectAgeNotSupportedException) {
sendErrorResponse(AppErrorResponse(AppErrorReason.AGE_GROUP_NOT_SUPPORTED))
handleErrorResponse(AppErrorResponse(AppErrorReason.AGE_GROUP_NOT_SUPPORTED))
return@launch
}

Expand All @@ -94,7 +94,7 @@ internal class OrchestratorViewModel @Inject constructor(
val errorResponse = mapRefusalOrErrorResult(result, projectConfiguration)
if (errorResponse != null) {
// Shortcut the flow execution if any refusal or error result is found
sendErrorResponse(errorResponse)
handleErrorResponse(errorResponse)
return@launch
}

Expand All @@ -121,7 +121,7 @@ internal class OrchestratorViewModel @Inject constructor(
doNextStep()
}

private fun sendErrorResponse(errorResponse: AppResponse) {
fun handleErrorResponse(errorResponse: AppResponse) {
addCallbackEvent(errorResponse)
_appResponse.send(OrchestratorResult(actionRequest, errorResponse))
}
Expand Down