Skip to content

Commit a2b8b51

Browse files
committed
Follow-Up: d70a916
Try preserving the original error message, if possible
1 parent 0c54bb0 commit a2b8b51

File tree

6 files changed

+380
-390
lines changed

6 files changed

+380
-390
lines changed

compiler/errors/sort.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
l = g.get(k)
6666
m = k.replace("_%d", "_X")
6767
l = l.replace("%d", "{value}")
68+
l = l.replace("\"", "'")
6869
l = l.replace("»", "»")
6970
l = l.replace("«", "«")
7071
l = l.replace("](/api/", f"]({b}/api/")

compiler/errors/source/400_BAD_REQUEST.tsv

Lines changed: 333 additions & 345 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
id message
22
ANONYMOUS_REACTIONS_DISABLED Sorry, anonymous administrators cannot leave reactions or participate in polls.
3-
BROADCAST_FORBIDDEN Channel poll voters and reactions cannot be fetched to prevent deanonymization.
4-
CHANNEL_PUBLIC_GROUP_NA channel/supergroup not available.
3+
BOT_OWNER_REQUIRED You must be the owner of the bot to perform this action
4+
BROADCAST_FORBIDDEN The request can't be used in channels
5+
CHANNEL_PUBLIC_GROUP_NA The channel/supergroup is not available
56
CHAT_ACTION_FORBIDDEN You cannot execute this action.
6-
CHAT_ADMIN_INVITE_REQUIRED You do not have the rights to do this.
7-
CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this.
7+
CHAT_ADMIN_INVITE_REQUIRED You don't have rights to invite other users
8+
CHAT_ADMIN_REQUIRED The method requires chat admin privileges
89
CHAT_FORBIDDEN You cannot write in this chat
9-
CHAT_GUEST_SEND_FORBIDDEN You join the discussion group before commenting, see [here](https://core.telegram.org/api/discussion#requiring-users-to-join-the-group) for more info.
10+
CHAT_GUEST_SEND_FORBIDDEN You join the discussion group before commenting, see [here »](https://core.telegram.org/api/discussion#requiring-users-to-join-the-group) for more info.
1011
CHAT_SEND_AUDIOS_FORBIDDEN You can't send audio messages in this chat.
1112
CHAT_SEND_DOCS_FORBIDDEN You can't send documents in this chat.
1213
CHAT_SEND_GAME_FORBIDDEN You can't send a game to this chat.
13-
CHAT_SEND_GIFS_FORBIDDEN You can't send gifs in this chat.
14-
CHAT_SEND_INLINE_FORBIDDEN You can't send inline messages in this group.
15-
CHAT_SEND_MEDIA_FORBIDDEN You can't send media in this chat.
14+
CHAT_SEND_GIFS_FORBIDDEN You can't send animations in this chat
15+
CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
16+
CHAT_SEND_MEDIA_FORBIDDEN You can't send media messages in this chat
1617
CHAT_SEND_PHOTOS_FORBIDDEN You can't send photos in this chat.
1718
CHAT_SEND_PLAIN_FORBIDDEN You can't send non-media (text) messages in this chat.
18-
CHAT_SEND_POLL_FORBIDDEN You can't send polls in this chat.
19-
CHAT_SEND_ROUNDVIDEOS_FORBIDDEN You cannot send video notes in this chat
20-
CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat.
19+
CHAT_SEND_POLL_FORBIDDEN You can't send polls in this chat
20+
CHAT_SEND_ROUNDVIDEOS_FORBIDDEN You can't send round videos to this chat.
21+
CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat
2122
CHAT_SEND_VIDEOS_FORBIDDEN You can't send videos in this chat.
2223
CHAT_SEND_VOICES_FORBIDDEN You can't send voice recordings in this chat.
23-
CHAT_WRITE_FORBIDDEN You can't write in this chat.
24-
EDIT_BOT_INVITE_FORBIDDEN Normal users can't edit invites that were created by bots.
24+
CHAT_WRITE_FORBIDDEN You don't have rights to send messages in this chat
25+
EDIT_BOT_INVITE_FORBIDDEN Bots' chat invite links can't be edited
2526
GROUPCALL_ALREADY_STARTED The groupcall has already started, you can join directly using [phone.joinGroupCall](https://core.telegram.org/method/phone.joinGroupCall).
2627
GROUPCALL_FORBIDDEN The group call has already ended.
27-
INLINE_BOT_REQUIRED Only the inline bot can edit message.
28-
MESSAGE_AUTHOR_REQUIRED Message author required.
29-
MESSAGE_DELETE_FORBIDDEN You can't delete one of the messages you tried to delete.
30-
NOT_ELIGIBLE You are not eligible to take part in Telegram's Premium for SMS initiative
28+
INLINE_BOT_REQUIRED The action must be performed through an inline bot callback
29+
MESSAGE_AUTHOR_REQUIRED You are not the author of this message
30+
MESSAGE_DELETE_FORBIDDEN You don't have rights to delete messages in this chat, most likely because you are not the author of them
31+
NOT_ELIGIBLE The current user is not eligible to join the Peer-to-Peer Login Program.
3132
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with [phone.joinGroupCall](https://core.telegram.org/method/phone.joinGroupCall).
32-
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method.
33-
PREMIUM_ACCOUNT_REQUIRED A premium account is required to execute this action.
33+
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
34+
PREMIUM_ACCOUNT_REQUIRED This action requires a premium account
3435
PRIVACY_PREMIUM_REQUIRED You need a [Telegram Premium subscription](https://core.telegram.org/api/premium) to send a message to this user.
3536
PUBLIC_CHANNEL_MISSING You can only export group call invite links for public chats or channels.
36-
RIGHT_FORBIDDEN Your admin rights do not allow you to do this.
37-
SENSITIVE_CHANGE_FORBIDDEN You can't change your sensitive content settings.
38-
TAKEOUT_REQUIRED A [takeout](https://core.telegram.org/api/takeout) session needs to be initialized first, [see here for more info](https://core.telegram.org/api/takeout).
39-
USER_BOT_INVALID User accounts must provide the `bot` method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts.
40-
USER_CHANNELS_TOO_MUCH One of the users you tried to add is already in too many channels/supergroups.
37+
RIGHT_FORBIDDEN You don't have enough rights for this action, or you tried to set one or more admin rights that can't be applied to this kind of chat (channel or supergroup)
38+
SENSITIVE_CHANGE_FORBIDDEN Your sensitive content settings can't be changed at this time
39+
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
40+
USER_BOT_INVALID This method can only be called by a bot
41+
USER_CHANNELS_TOO_MUCH One of the users you tried to add is already in too many channels/supergroups
4142
USER_DELETED You can't send this secret message because the other participant deleted their account.
42-
USER_INVALID Invalid user provided.
43-
USER_IS_BLOCKED You were blocked by this user.
44-
USER_NOT_MUTUAL_CONTACT The provided user is not a mutual contact.
43+
USER_INVALID The provided user is invalid
44+
USER_IS_BLOCKED The user is blocked
45+
USER_NOT_MUTUAL_CONTACT The provided user is not a mutual contact
4546
USER_NOT_PARTICIPANT You're not a member of this supergroup/channel.
46-
USER_PRIVACY_RESTRICTED The user's privacy settings do not allow you to do this.
47-
USER_RESTRICTED You're spamreported, you can't create channels or chats.
47+
USER_PRIVACY_RESTRICTED The user's privacy settings is preventing you to perform this action
48+
USER_RESTRICTED You are limited/restricted. You can't perform this action
4849
VOICE_MESSAGES_FORBIDDEN This user's privacy settings forbid you from sending voice messages.
4950
YOUR_PRIVACY_RESTRICTED You cannot fetch the read date of this message because you have disallowed other users to do so for *your* messages; to fix, allow other users to see *your* exact last online date OR purchase a [Telegram Premium](https://core.telegram.org/api/premium) subscription.

compiler/errors/source/406_NOT_ACCEPTABLE.tsv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ CALL_PROTOCOL_COMPAT_LAYER_INVALID The other side of the call does not support a
77
CHANNEL_PRIVATE You haven't joined this channel/supergroup.
88
CHANNEL_TOO_LARGE Channel is too large to be deleted; this error is issued when trying to delete channels with more than 1000 members (subject to change).
99
CHAT_FORWARDS_RESTRICTED You can't forward messages from a protected chat.
10-
FILEREF_UPGRADE_NEEDED The client has to be updated in order to support [file references](https://core.telegram.org/api/file_reference).
11-
FRESH_CHANGE_ADMINS_FORBIDDEN You were just elected admin, you can't add or modify other admins yet.
12-
FRESH_CHANGE_PHONE_FORBIDDEN You can't change phone number right after logging in, please wait at least 24 hours.
13-
FRESH_RESET_AUTHORISATION_FORBIDDEN You can't logout other sessions if less than 24 hours have passed since you logged on the current session.
10+
FILEREF_UPGRADE_NEEDED The file reference has expired and you must use a refreshed one by obtaining the original media message. The client has to be updated in order to support [file references](https://core.telegram.org/api/file_reference).
11+
FRESH_CHANGE_ADMINS_FORBIDDEN You were just elected admin, you can't add or modify other admins yet
12+
FRESH_CHANGE_PHONE_FORBIDDEN You can't change your phone number because your session was logged-in recently
13+
FRESH_RESET_AUTHORISATION_FORBIDDEN You can't terminate other authorized sessions because the current was logged-in recently
1414
INVITE_HASH_EXPIRED The invite link has expired.
1515
PAYMENT_UNSUPPORTED A detailed description of the error will be received separately as described [here](https://core.telegram.org/api/errors#406-not-acceptable).
16-
PHONE_NUMBER_INVALID The phone number is invalid.
17-
PHONE_PASSWORD_FLOOD You have tried logging in too many times.
16+
PHONE_NUMBER_INVALID The phone number is invalid
17+
PHONE_PASSWORD_FLOOD You have tried logging in too many times
1818
PREMIUM_CURRENTLY_UNAVAILABLE You cannot currently purchase a Premium subscription.
1919
PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN Import for this chat is already in progress, wait {value} minutes before starting a new one.
2020
PRIVACY_PREMIUM_REQUIRED You need a [Telegram Premium subscription](https://core.telegram.org/api/premium) to send a message to this user.
2121
SEND_CODE_UNAVAILABLE Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend).
2222
STICKERSET_INVALID The provided sticker set is invalid.
23-
STICKERSET_OWNER_ANONYMOUS Provided stickerset can't be installed as group stickerset to prevent admin deanonymization.
23+
STICKERSET_OWNER_ANONYMOUS This sticker set can't be used as the group's sticker set to prevent admin deanonymization.
2424
TOPIC_CLOSED This topic was closed, you can't send messages to it anymore.
2525
TOPIC_DELETED The specified topic was deleted.
2626
UPDATE_APP_TO_LOGIN Please update to the latest version of MadelineProto to login.
2727
USERPIC_PRIVACY_REQUIRED You need to disable privacy settings for your profile picture in order to make your geolocation public.
28-
USERPIC_UPLOAD_REQUIRED You must have a profile picture to publish your geolocation.
29-
USER_RESTRICTED You're spamreported, you can't create channels or chats.
28+
USERPIC_UPLOAD_REQUIRED You must have a profile picture to publish your geolocation
29+
USER_RESTRICTED You are limited/restricted. You can't perform this action

compiler/errors/source/420_FLOOD.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id message
22
2FA_CONFIRM_WAIT_X Since this account is active and protected by a 2FA password, we will delete it in 1 week for security purposes. You can cancel this process at any time, you'll be able to reset your account in {value} seconds.
33
ADDRESS_INVALID The specified geopoint address is invalid.
4-
FLOOD_PREMIUM_WAIT_X A wait of {value} seconds is required
4+
FLOOD_PREMIUM_WAIT_X Please wait {value} seconds before repeating the action, or purchase a [Telegram Premium subscription](https://core.telegram.org/api/premium) to remove this rate limit.
55
FLOOD_TEST_PHONE_WAIT_X A wait of {value} seconds is required in the test servers
66
FLOOD_WAIT_X A wait of {value} seconds is required
77
PREMIUM_SUB_ACTIVE_UNTIL_X You already have a premium subscription active until unixtime {value} .

compiler/errors/source/500_INTERNAL_SERVER_ERROR.tsv

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
id message
22
API_CALL_ERROR API call error due to Telegram having internal problems. Please try again later
3-
AUTH_RESTART Restart the authorization process.
4-
CALL_OCCUPY_FAILED The call failed because the user is already making another call.
3+
AUTH_RESTART User authorization must be restarted
4+
CALL_OCCUPY_FAILED The call failed because the user is already making another call
55
CDN_UPLOAD_TIMEOUT A server-side timeout occurred while reuploading the file to the CDN DC.
6-
CHAT_ID_GENERATE_FAILED Failure while generating the chat ID.
6+
CHAT_ID_GENERATE_FAILED Failure while generating the chat ID due to Telegram having internal problems. Please try again later
77
CHAT_INVALID Invalid chat.
88
CHAT_OCCUPY_LOC_FAILED An internal error occurred while creating the chat
99
CHAT_OCCUPY_USERNAME_FAILED Failure to occupy chat username due to Telegram having internal problems. Please try again later
@@ -29,18 +29,18 @@ NEED_CHAT_INVALID The provided chat is invalid
2929
NEED_MEMBER_INVALID The provided member is invalid or does not exist
3030
No workers running The Telegram server is restarting its workers. Try again later.
3131
PARTICIPANT_CALL_FAILED Failure while making call due to Telegram having internal problems. Please try again later
32-
PERSISTENT_TIMESTAMP_OUTDATED Channel internal replication issues, try again later (treat this like an RPC_CALL_FAIL).
32+
PERSISTENT_TIMESTAMP_OUTDATED Channel internal replication issues, try again later (treat this like an ``RPC_CALL_FAIL``)
3333
PHOTO_CREATE_FAILED The creation of the photo failed due to Telegram having internal problems. Please try again later
3434
POSTPONED_TIMEOUT Telegram is having internal problems. Please try again later
3535
PTS_CHANGE_EMPTY No PTS change
36-
RANDOM_ID_DUPLICATE You provided a random ID that was already used.
36+
RANDOM_ID_DUPLICATE You provided a random ID that was already used
3737
REG_ID_GENERATE_FAILED The registration id failed to generate due to Telegram having internal problems. Please try again later
3838
RPC_CALL_FAIL Telegram is having internal problems. Please try again later
3939
RPC_CONNECT_FAILED Telegram is having internal problems. Please try again later
4040
RPC_MCGET_FAIL Telegram is having internal problems. Please try again later
4141
RPC_SEND_FAIL Telegram is having internal problems. Please try again later
4242
SEND_MEDIA_INVALID The specified media is invalid.
43-
SIGN_IN_FAILED Failure while signing in.
43+
SIGN_IN_FAILED Failure while signing in due to Telegram having internal problems. Please try again later
4444
STORAGE_CHECK_FAILED Server storage check failed due to Telegram having internal problems. Please try again later
4545
STORAGE_CHOOSE_VOLUME_FAILED Storage choose volume failed due to Telegram having internal problems. Please try again later
4646
STORE_INVALID_SCALAR_TYPE Telegram is having internal problems. Please try again later

0 commit comments

Comments
 (0)