Skip to content
Open
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
4 changes: 4 additions & 0 deletions app/src/main/kotlin/ee/ria/DigiDoc/exceptions/NFCError.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ sealed class NFCError {
override val message: Int,
) : NFCError()

data class InvalidSslHandshake(
override val message: Int,
) : NFCError()

data class NoLockFound(
override val message: Int,
) : NFCError()
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/kotlin/ee/ria/DigiDoc/viewmodel/NFCViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,11 @@ class NFCViewModel
errorLog(logTag, "Unable to sign with NFC - Unable to create proxy connection with host", e)
}

private fun showSslHandshakeError(e: Exception) {
_errorState.update { NFCError.InvalidSslHandshake(R.string.invalid_ssl_handshake) }
errorLog(logTag, "Unable to sign with NFC - Failed to create SSL connection with host", e)
}

private fun showNoLockFoundError(e: Exception) {
_errorState.update { NFCError.NoLockFound(R.string.no_lock_found) }
errorLog(logTag, "Unable to decrypt with NFC - No lock found with certificate key", e)
Expand Down Expand Up @@ -882,6 +887,11 @@ class NFCViewModel
true
}

message.contains("Failed to create ssl connection with host") -> {
showSslHandshakeError(ex)
true
}

message.contains("Too Many Requests") -> {
setErrorState(SessionStatusResponseProcessStatus.TOO_MANY_REQUESTS)
true
Expand Down
Loading