瀏覽代碼

lpac_jni: Clear exceptions before setting response

Peter Cai 1 年之前
父節點
當前提交
96bc9865ff
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      libs/lpac-jni/src/main/java/net/typeblog/lpac_jni/impl/LocalProfileAssistantImpl.kt

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