HTTP 400 · Bad Request
PASSWORD_TOO_FRESH_X
The password was modified less than 24 hours ago, try again in %v seconds.
HTTP 400
Authentication
Parameterized
When & why it happens
The 2FA password was changed recently and is still under cooldown for sensitive operations. Wait the supplied seconds.
Parameterized error
The wire code carries a parameter on its tail (literal you'll see: PASSWORD_TOO_FRESH_42). Gogram parses it out and stores it on ErrResponseCode.AdditionalInfo with the right type.
Handling in gogram
Surfaced as *gogram.ErrResponseCode. Match on the message:
if err, ok := err.(*gogram.ErrResponseCode); ok {
if strings.HasPrefix(err.Message, "PASSWORD_TOO_FRESH") {
secs := err.AdditionalInfo.(int)
time.Sleep(time.Duration(secs) * time.Second)
// retry
}
}
Related errors
2FA_CONFIRM_WAIT_XYou'll be able to reset your account in %v seconds. If not, account will be deleted in 1 week for security reasons.ACCESS_TOKEN_EXPIREDAccess token expired.ACCESS_TOKEN_INVALIDAccess token invalid.AUTH_BYTES_INVALIDThe provided authorization is invalid.AUTH_KEY_DUPLICATEDThe authorization key was used under two different IP addresses simultaneously and is now invalid.AUTH_KEY_INVALIDThe Authorization Key is invalid.AUTH_KEY_PERM_EMPTYThe method is unavailable for temporary authorization keys, not bound to permanent.AUTH_KEY_UNREGISTEREDThe key is not registered in the system.AUTH_RESTARTRestart the authorization process.AUTH_TOKEN_ALREADY_ACCEPTEDThe specified auth token was already accepted.AUTH_TOKEN_EXCEPTIONAn error occurred while importing the auth token.AUTH_TOKEN_EXPIREDThe authorization token has expired.