Browse Source

lpac_jni: Clear exceptions before setting response

Peter Cai 1 year ago
parent
commit
96bc9865ff

+ 2 - 0
libs/lpac-jni/src/main/java/net/typeblog/lpac_jni/impl/LocalProfileAssistantImpl.kt

@@ -30,6 +30,7 @@ class LocalProfileAssistantImpl(
         override fun transmit(tx: ByteArray): ByteArray =
         override fun transmit(tx: ByteArray): ByteArray =
             try {
             try {
                 apduInterface.transmit(tx).also {
                 apduInterface.transmit(tx).also {
+                    lastApduException = null
                     lastApduResponse = it
                     lastApduResponse = it
                 }
                 }
             } catch (e: Exception) {
             } catch (e: Exception) {
@@ -61,6 +62,7 @@ class LocalProfileAssistantImpl(
         override fun transmit(url: String, tx: ByteArray, headers: Array<String>): HttpResponse =
         override fun transmit(url: String, tx: ByteArray, headers: Array<String>): HttpResponse =
             try {
             try {
                 httpInterface.transmit(url, tx, headers).also {
                 httpInterface.transmit(url, tx, headers).also {
+                    lastHttpException = null
                     lastHttpResponse = it
                     lastHttpResponse = it
                 }
                 }
             } catch (e: Exception) {
             } catch (e: Exception) {