-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from tw-mosip/release-0.3.x
[Release 19-04-2023] Stability improvements & Windows build fix
- Loading branch information
Showing
111 changed files
with
335 additions
and
7,885 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
android/src/main/java/io/mosip/tuvali/common/safeExecute/TryExecuteSync.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.mosip.tuvali.common.safeExecute | ||
|
||
import io.mosip.tuvali.openid4vpble.exception.OpenIdBLEExceptionHandler | ||
|
||
class TryExecuteSync(private val bleExceptionHandler: OpenIdBLEExceptionHandler) { | ||
private val mutex = Object() | ||
|
||
fun <T> run(fn: () -> T): T? { | ||
var returnValue: T? = null; | ||
|
||
synchronized(mutex) { | ||
try { | ||
returnValue = fn() | ||
} catch (e: Exception) { | ||
bleExceptionHandler.handleException(Exception("Unknown Exception", e)) | ||
} | ||
} | ||
|
||
return returnValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
android/src/main/java/io/mosip/tuvali/openid4vpble/exception/StateHandlerException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.mosip.tuvali.openid4vpble.exception | ||
|
||
class StateHandlerException(message: String, cause: Throwable): Exception(message, cause) { | ||
} |
4 changes: 4 additions & 0 deletions
4
android/src/main/java/io/mosip/tuvali/openid4vpble/exception/TransferHandlerException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.mosip.tuvali.openid4vpble.exception | ||
|
||
class TransferHandlerException(message: String, cause: Throwable): Exception(message, cause) { | ||
} |
4 changes: 0 additions & 4 deletions
4
...d/src/main/java/io/mosip/tuvali/openid4vpble/exception/exception/StateHandlerException.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...rc/main/java/io/mosip/tuvali/openid4vpble/exception/exception/TransferHandlerException.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
android/src/main/java/io/mosip/tuvali/verifier/exception/ReadFromRemoteException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package io.mosip.tuvali.verifier.exception | ||
|
||
class ReadFromRemoteException: Throwable() { | ||
class ReadFromRemoteException: Exception() { | ||
} |
2 changes: 1 addition & 1 deletion
2
android/src/main/java/io/mosip/tuvali/verifier/exception/VerifierException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.mosip.tuvali.verifier.exception | ||
|
||
open class VerifierException(message: String): Throwable(message) | ||
open class VerifierException(message: String, cause: Throwable? = null): Exception(message, cause) |
8 changes: 7 additions & 1 deletion
8
android/src/main/java/io/mosip/tuvali/verifier/exception/VerifierExceptionHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package io.mosip.tuvali.verifier.exception | ||
|
||
import android.util.Log | ||
import io.mosip.tuvali.openid4vpble.exception.StateHandlerException | ||
import io.mosip.tuvali.openid4vpble.exception.TransferHandlerException | ||
import io.mosip.tuvali.transfer.Util | ||
|
||
class VerifierExceptionHandler(val sendError: (String) -> Unit) { | ||
private val logTag = Util.getLogTag(javaClass.simpleName) | ||
|
||
fun handleException(e: VerifierException){ | ||
Log.e(logTag, "Verifier Exception: $e") | ||
when (e.cause?.javaClass?.simpleName) { | ||
StateHandlerException::class.simpleName -> Log.e(logTag, "Verifier State Handler Exception: ${e.cause}") | ||
TransferHandlerException::class.simpleName -> Log.e(logTag, "Verifier Transfer Handler Exception: ${e.cause}") | ||
else -> Log.e(logTag, "Verifier Exception: $e") | ||
} | ||
sendError(e.message ?: "Something went wrong in Verifier: ${e.cause}") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.