Skip to content

Instantly share code, notes, and snippets.

@stek29
Created September 11, 2017 13:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stek29/e029a15a76db44488920767d80123ef0 to your computer and use it in GitHub Desktop.
Save stek29/e029a15a76db44488920767d80123ef0 to your computer and use it in GitHub Desktop.

Error codes

According to Webogram (And TDesktop a bit)

  • 400 -- Bad request (Almost all errors)
  • 401 -- Unauthorized
  • 403 -- Forbidden
  • 404 -- Not found
  • 406 -- Network
  • 420 -- Flood
  • 500 and greater -- "Temporary" errors

Error types

According to TDesktop, Webogram, Android and iOS apps, users' reports and my own testst

PHONE_CODE_EMPTY

See PHONE_CODE_INVALID.

PHONE_CODE_EXPIRED

See PHONE_CODE_INVALID.

PHONE_CODE_INVALID

Wrong confirmation code. Returned by API methods account.confirmPhone or auth.signIn.

PHONE_NUMBER_INVALID

Invalid phone number. Returned by API methods auth.checkPhone, account.sendChangePhoneCode, account.sendConfirmPhoneCode and others with phone_number.

PHONE_NUMBER_UNOCCUPIED

Should be automatically handled by app. It should ask user to signUp, not signIn, because number isn't occupied. Returned by API method auth.signIn.

PHONE_NUMBER_OCCUPIED

User tried to change his number to already occupied one. Returned by API method account.sendChangePhoneCode.

SESSION_PASSWORD_NEEDED

Should be automatically handled by app. Means that account uses two step verification. App should ask user to type his password. Returned by API method auth.signIn.

PASSWORD_EMPTY

See PASSWORD_HASH_INVALID.

PASSWORD_HASH_INVALID

Wrong 2FA password. Returned by API methods auth.signIn, account.updatePasswordSettings and auth.recoverPassword.

PHONE_PASSWORD_PROTECTED

Returned to old apps without 2FA support when trying to log into 2FA protected account. Returned by API method auth.signIn.

EMAIL_INVALID

Incorrect 2FA restore Email. Returned by API method account.updatePasswordSettings.

EMAIL_UNCONFIRMED

User haven't confirmed 2FA restore Email yet. Not an error exactly, just a warning. Usually means that user should be asked to confirm. Returned by API method account.updatePasswordSettings.

2FA_RECENT_CONFIRM

Your recent attempts to reset this account have been cancelled by its active user. Please try again in 7 days.";

2FA_CONFIRM_WAIT_X

Since the account {phone_number} is active and protected by a password, we will delete it in 1 week for security purposes. You can cancel this process at any time.\n\nYou’ll be able to reset your account in:\n{when}";

NEW_PASSWORD_BAD

Bad 2FA password. Usually means that user tried to set same hint and password. Returned by API method account.updatePasswordSettings.

NEW_SALT_INVALID

Should be automatically handled by app. Service message, usually means that app should retry with other salt. Returned by API method account.updatePasswordSettings.

CODE_INVALID

Invalid recovery code from 2FA email Returned by API method auth.recoverPassword.

PASSWORD_RECOVERY_EXPIRED

See CODE_INVALID

FLOOD_WAIT_X

Means that app has made too much API calls and has to wait X seconds before making more. Can be Returned by any API method.

USERNAME_NOT_MODIFIED

Usually is automatically handled by app. Means that app tried to set new username to the old value. Retuned by API method account.updateUsername.

USERNAME_INVALID

Means that username is invalid. Retuned by API method account.updateUsername.

USERNAME_OCCUPIED

Username is already taken. Retuned by API method account.updateUsername.

USERNAMES_UNAVAILABLE

Usernames aren't available in current country (or on current DC ?_?) TDesktop handles it like USERNAME_OCCUPIED Retuned by API method account.updateUsername.

MESSAGE_EMPTY

App tried to send empty message text (or nonexistent/invalid media). Returned by API methods messages.editMessage, messages.sendMessage and messages.sendMedia.

MESSAGE_NOT_MODIFIED

Usually is automatically handled by app. Means that app tried to set new message text to the old value. Returned by API method messages.editMessage.

MESSAGE_EDIT_TIME_EXPIRED

Messages can't be edited after some amount of time (look at help.Config). Returned by API method messages.editMessage.

MESSAGE_AUTHOR_REQUIRED

User obviously can't edit messages not authored by him. Returned by API method messages.editMessage.

CHAT_ADMIN_REQUIRED

User can't edit/send messages in channel if he's not an admin. Returned by API methods messages.sendMessage or messages.editMessage.

MESSAGE_ID_INVALID

Returned when app tries to make any action with nonexistent (including deleted/revoked) message id. Returned by API methods messages.editMessage, messages.forwardMessage and maybe other methods with message ids.

RANDOM_ID_EMPTY

Service message, usually means that app forgot to send random_id. Returned by any API method with random_id.

PEER_FLOOD

Usually spam report related. Official apps show More info button, which opens chat with @SpamBot. Returned when trying to message non-mutal contacts while limited, or when adding too much users to channel/group.

USER_BLOCKED

USER_BOT

USER_ID_INVALID

USERS_TOO_MUCH

USER_NOT_MUTUAL_CONTACT

ADMINS_TOO_MUCH

BOTS_TOO_MUCH

USER_PRIVACY_RESTRICTED

USERS_TOO_FEW

USER_RESTRICTED

NO_CHAT_TITLE

Shouldn't it be CHAT TITLE EMPTY?

CHAT_NOT_MODIFIED

AUTH_KEY_UNREGISTERED

FILE_ID_INVALID

CHANNEL_PRIVATE

CHANNEL_PUBLIC_GROUP_NA

USER_BANNED_IN_CHANNEL

FIRSTNAME_INVALID

Empty or Too long is invalid too

LASTNAME_INVALID

ABOUT_TOO_LONG

There's no about not modified!

CHAT_ABOUT_NOT_MODIFIED

autohandle

CHAT_ABOUT_TOO_LONG

CHAT_TITLE_NOT_MODIFIED

Means that app tried to set new title to the old value. Returned by channels.editTitle.

CHAT_TITLE_TOO_LONG

See CHAT_TITLE_EMPTY.

CHAT_TITLE_EMPTY

Chat title can't be empty or too long. Returned by channels.editTitle and channels.createChannel.

INVITE_HASH_EXPIRED

INVITE_HASH_INVALID

INVITE_HASH_EMPTY

USERNAME_NOT_OCCUPIED

Disabled too

PEER_ID_INVALID

Following text should be rechecked and rewritten, because I should not use text from Trello. Can happen in different cases, inter alia, user was kicked from a channel, it can also be returned if a bot knows the user, but there is no messages sent from the user to bot. It may happen even when user send message to the bot, but after that bot has sent or received more than 1000000 messages and messages from the user was automatically deleted and even when a user deleted his account and another user tries to send him a message.

webogram specific
### # USER\_NOT\_USING\_TELEGRAM
importContact
### # USERS\_NOT\_USING\_TELEGRAM
See [USER\_NOT\_USING\_TELEGRAM](#user-not-using-telegram)
Maybe only if all of them are not using it?

X_MIGRATE_Y

Autohandle X is (FILE|PHONE|NETWORK|USER) Y is DC number

MSG_WAIT_FAILED

invokeAfterMsg related

INPUT_LAYER_INVALID

INPUT_METHOD_INVALID

INPUT_REQUEST_TOO_LONG

Sending params to method/constructor with no params

INPUT_FETCH_ERROR

Params missing, unknown constructors and other problems

FILE_ID_INVALID

Only for getFile, for sendMedia see message empty

LIMIT_INVALID

upload.getFile: invalid limit, but not offset (even -1)

WEBPAGE_MEDIA_EMPTY

Tried to send inputMediaDocumentExternal with link to placehold.it/640x360

INPUT_CONSTRUCTOR_INVALID

Deleted one of messages.getDialogs params

EXTERNAL_URL_INVALID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment