-
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 #53 from tw-mosip/add-exception-handling-to-androi…
…d-missing-files-hotfix [Android] Add exception handling to missing Classes
- Loading branch information
Showing
15 changed files
with
38 additions
and
33 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
2 changes: 1 addition & 1 deletion
2
...eption/exception/StateHandlerException.kt → ...4vpble/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package io.mosip.tuvali.openid4vpble.exception.exception | ||
package io.mosip.tuvali.openid4vpble.exception | ||
|
||
class StateHandlerException(message: String, cause: Throwable): Exception(message, cause) { | ||
} |
2 changes: 1 addition & 1 deletion
2
...ion/exception/TransferHandlerException.kt → ...ble/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package io.mosip.tuvali.openid4vpble.exception.exception | ||
package io.mosip.tuvali.openid4vpble.exception | ||
|
||
class TransferHandlerException(message: String, cause: Throwable): Exception(message, 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
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): Exception(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
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/wallet/exception/WalletException.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.wallet.exception | ||
|
||
open class WalletException(message: String): Exception(message) | ||
open class WalletException(message: String, cause: Throwable? = null): Exception(message, cause) |
8 changes: 7 additions & 1 deletion
8
android/src/main/java/io/mosip/tuvali/wallet/exception/WalletExceptionHandler.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.wallet.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 WalletExceptionHandler(val sendError: (String) -> Unit) { | ||
private val logTag = Util.getLogTag(javaClass.simpleName) | ||
|
||
fun handleException(e: WalletException){ | ||
Log.e(logTag, "Wallet Exception: $e") | ||
when (e.cause?.javaClass?.simpleName) { | ||
StateHandlerException::class.simpleName -> Log.e(logTag, "Wallet State Handler Exception: ${e.cause}") | ||
TransferHandlerException::class.simpleName -> Log.e(logTag, "Wallet Transfer Handler Exception: ${e.cause}") | ||
else -> Log.e(logTag, "Wallet Exception: $e") | ||
} | ||
sendError(e.message ?: "Something went wrong in Wallet: ${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