-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Niganesh/align with error spec 1 (#47)
Co-authored-by: Nithya Ganesh <[email protected]>
- Loading branch information
1 parent
5978f33
commit 904aef3
Showing
11 changed files
with
119 additions
and
48 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
21 changes: 21 additions & 0 deletions
21
walletlibrary/src/main/java/com/microsoft/walletlibrary/util/VerifiedIdException.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 com.microsoft.walletlibrary.util | ||
|
||
sealed class VerifiedIdException(message: String, val code: String, val correlationId: String? = null): Exception(message) { | ||
fun <T>toVerifiedIdResult(): VerifiedIdResult<T> { | ||
return VerifiedIdResult.failure(this) | ||
} | ||
} | ||
class NetworkingException( | ||
message: String, | ||
code: String, | ||
correlationId: String? = null, | ||
statusCode: String? = null, | ||
innerError: Exception? = null, | ||
retryable: Boolean = false | ||
) : VerifiedIdException(message, code, correlationId) | ||
|
||
class RequirementNotMetException(message: String, code: String, correlationId: String? = null) : | ||
VerifiedIdException(message, code, correlationId) | ||
|
||
class UnspecifiedVerifiedIdException(message: String, code: String, val innerError: Exception? = null, correlationId: String? = null) : | ||
VerifiedIdException(message, code, correlationId) |
7 changes: 7 additions & 0 deletions
7
walletlibrary/src/main/java/com/microsoft/walletlibrary/util/VerifiedIdExceptions.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,7 @@ | ||
package com.microsoft.walletlibrary.util | ||
|
||
enum class VerifiedIdExceptions(val value: String) { | ||
NETWORKING_EXCEPTION("networking_error"), | ||
REQUIREMENT_NOT_MET_EXCEPTION("requirement_not_met"), | ||
UNSPECIFIED_EXCEPTION("unspecified_error") | ||
} |
3 changes: 3 additions & 0 deletions
3
walletlibrary/src/main/java/com/microsoft/walletlibrary/util/VerifiedIdResult.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,3 @@ | ||
package com.microsoft.walletlibrary.util | ||
|
||
typealias VerifiedIdResult<T> = Result<T> |
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