beemdevelopment/Aegis · error · ParseException

The entered info is incorrect:

Error message

The entered info is incorrect: 

What it means

After constructing the OtpInfo, EditEntryActivity.parseEntry() calls info.setDigits(digits) and info.setAlgorithm(algo); if the OtpInfo layer rejects these values it throws OtpInfoException, which is wrapped in a ParseException prefixed 'The entered info is incorrect: '. This guards against combinations the OTP implementation cannot use, such as unsupported digit counts or algorithm names.

Solutions

  1. Use a supported digits value (typically 6-8) and a supported algorithm (SHA1/SHA256/SHA512 as offered by the UI dropdowns)
  2. Read the appended OtpInfoException message — it names the exact invalid parameter
  3. Reset the entry's advanced settings to the provider defaults (6 digits, SHA1)

Example fix

// before
info.setDigits(20); // OtpInfoException: outside allowed range
// after
info.setDigits(6);
Defensive patterns

Strategy: try-catch

Validate before calling

int digits = Integer.parseInt(_textDigits.getText().toString());
if (digits < 6 || digits > 8) {
    _textDigitsLayout.setError("Digits must be 6-8");
    return;
}
if (!SUPPORTED_ALGOS.contains(_dropdownAlgo.getText().toString())) {
    _dropdownAlgoLayout.setError("Unsupported algorithm");
    return;
}

Try / catch

try {
    saveEntry();
} catch (ParseException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("The entered info is incorrect:")) {
        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
    }
}

Prevention

When it happens

Trigger: Saving an entry where setDigits/setAlgorithm fails — e.g. digits outside the allowed range for the OTP type, or an algorithm string not among the supported SHA variants for that OtpInfo class.

Common situations: Entering unusual digit counts (e.g. 3 or 20), selecting an algorithm not supported by the chosen OTP type, or an issuer/provider config requiring incompatible parameters.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08). Data as JSON: /api/errors/9d22b995a1e11cf2. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/com/beemdevelopment/aegis/ui/EditEntryActivity.java:791

                    } catch (NumberFormatException e) {
                        throw new ParseException("Counter is not an integer.");
                    }
                    info = new HotpInfo(secret, algo, digits, counter);
                    break;
                case YandexInfo.ID:
                    info = new YandexInfo(secret, _textPin.getText().toString());
                    break;
                case MotpInfo.ID:
                    info = new MotpInfo(secret, _textPin.getText().toString());
                    break;
                default:
                    throw new RuntimeException(String.format("Unsupported OTP type: %s", type));
            }

            info.setDigits(digits);
            info.setAlgorithm(algo);
        } catch (OtpInfoException e) {
            throw new ParseException("The entered info is incorrect: " + e.getMessage());
        }

        VaultEntry entry = Cloner.clone(_origEntry);
        entry.setInfo(info);
        entry.setIssuer(_textIssuer.getText().toString());
        entry.setName(_textName.getText().toString());
        entry.setNote(_textNote.getText().toString());

        if (_selectedGroups.isEmpty()) {
            entry.setGroups(new HashSet<>());
        } else {
            entry.setGroups(new HashSet<>(_selectedGroups));
        }

        if (_hasChangedIcon) {
            if (_hasCustomIcon) {
                VaultEntryIcon icon;
                if (_selectedIcon == null) {

View on GitHub (pinned to d6f4e5925a)