Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ed99955
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 19, 2025
994401e
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 19, 2025
c72a004
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 19, 2025
8cfa122
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 19, 2025
1c91a4a
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
f4e4ef6
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
c100013
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
1eda9d8
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
e99b246
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
f5ab546
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
b4c8231
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
01a72bb
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
21826fe
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
5fbbf8e
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
fdc868f
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
f96805b
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
3f5de13
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 20, 2025
dbbc678
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 21, 2025
389fdfc
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 21, 2025
fcba943
Merge branch 'master' of https://github.com/dimagi/commcare-android i…
conroy-ricketts Nov 24, 2025
618b0f4
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 24, 2025
3eb80a0
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 24, 2025
4818fdb
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 25, 2025
d5c520f
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 25, 2025
4ae9a19
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 25, 2025
25afef8
CCCT-1889 Personal ID Error Codes
conroy-ricketts Nov 26, 2025
12f724a
Merge branch 'master' of https://github.com/dimagi/commcare-android i…
conroy-ricketts Nov 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion app/src/org/commcare/connect/network/base/BaseApiHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,79 @@ abstract class BaseApiHandler<T>(
}

enum class PersonalIdOrConnectApiErrorCodes {
// A catch-all for errors with an unusual response code.
UNKNOWN_ERROR,

// Typical network errors like not having an internet connection.
NETWORK_ERROR,

// The app is outdated and needs to be updated.
OLD_API_ERROR,

// Examples of this include the user being in an unsupported country, an uninvited user
// receiving an OTP, or an integrity failure.
FORBIDDEN_ERROR,

// The request to get an SSO auth token failed, usually due to network issues.
TOKEN_UNAVAILABLE_ERROR,

// The request to get an SSO auth token is denied.
TOKEN_DENIED_ERROR,

// The firebase ID token is invalid.
TOKEN_INVALID_ERROR,
INVALID_RESPONSE_ERROR,

// There was an issue parsing an API response.
JSON_PARSING_ERROR,

// Examples of this include user account lockout or an expired SSO auth token.
FAILED_AUTH_ERROR,

// Examples of this include a user profile photo failing to upload or the photo being too
// large.
SERVER_ERROR,

// There were too many request attempts.
RATE_LIMIT_EXCEEDED_ERROR,

// The user enetered an incorrect backup code too many times.
ACCOUNT_LOCKED_ERROR,

// The user's device did not pass security checks.
INTEGRITY_ERROR,
BAD_REQUEST_ERROR, ;

// There is something wrong with the API request such as a lost PersonalID configuration.
BAD_REQUEST_ERROR,

// The user's backup code is not set correctly.
NO_RECOVERY_PIN_SET_ERROR,

// There's missing data in the API request.
MISSING_DATA_ERROR,

// There was a phone number mismatch when vaildating the firebase ID token.
PHONE_MISMATCH_ERROR,

// The firebase ID token was missing when validating it.
MISSING_TOKEN_ERROR,

// There was an issue verifying the firebase ID token.
FAILED_VALIDATING_TOKEN_ERROR,

// The user's name is missing from the API request.
NAME_REQUIRED_ERROR,

// The user attempted to create a new profile with a phone number that's already tied to an
// existing account.
ACTIVE_USER_EXISTS_ERROR,

// The OTP the user entered is incorrect.
INCORRECT_OTP_ERROR,

// The photo uploaded for the user is too large for server to handle. Note that, currently,
// the user does not have much control over the photo size.
FILE_TOO_LARGE_ERROR, ;

fun shouldAllowRetry(): Boolean =
this == NETWORK_ERROR || (this == TOKEN_UNAVAILABLE_ERROR) || (this == SERVER_ERROR) || (this == UNKNOWN_ERROR) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static String handle(Context context, PersonalIdApiHandler.PersonalIdOrCo
return context.getString(R.string.personalid_configuration_process_failed_subtitle);
case UNKNOWN_ERROR:
return context.getString(R.string.recovery_network_unknown);
case INCORRECT_OTP_ERROR:
return context.getString(R.string.personalid_incorrect_otp);
default:
if (t != null) {
Logger.exception("Unhandled throwable passed with API error code: " + errorCode, t);
Expand Down
Loading