mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix(api)!: align error codes with throw sites and image bounds (#2488)
This commit is contained in:
1 parent
4534822355
commit
d5bfa5a73d
99 files changed
+857
-4853
No files matched your search
@@ -10,19 +10,15 @@ type AllErrorCodes = APIErrorCode | ValidationErrorCode;
|
||||
|
||||
export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.ACCESS_DENIED]: 'permissions.missing_access',
|
||||
[APIErrorCodes.ACCOUNT_DISABLED]: 'account.disabled',
|
||||
[APIErrorCodes.ACCOUNT_SCHEDULED_FOR_DELETION]: 'account.scheduled_for_deletion',
|
||||
[APIErrorCodes.ACCOUNT_SUSPENDED_PERMANENTLY]: 'account.suspended_permanently',
|
||||
[APIErrorCodes.ACCOUNT_SUSPENDED_TEMPORARILY]: 'account.suspended_temporarily',
|
||||
[APIErrorCodes.ACCOUNT_SUSPICIOUS_ACTIVITY]: 'account.locked_suspicious_activity',
|
||||
[APIErrorCodes.ACCOUNT_TOO_NEW_FOR_GUILD]: 'account.too_new_for_guild',
|
||||
[APIErrorCodes.ACLS_MUST_BE_NON_EMPTY]: 'admin_and_system.acls_must_be_non_empty',
|
||||
[APIErrorCodes.ADMIN_API_KEY_NOT_FOUND]: 'admin_and_system.admin_api_key_not_found',
|
||||
[APIErrorCodes.APPLICATION_NOT_FOUND]: 'unknown_entities.unknown_application',
|
||||
[APIErrorCodes.APPLICATION_NOT_OWNED]: 'auth_and_oauth.application_not_owned',
|
||||
[APIErrorCodes.ALREADY_FRIENDS]: 'friends_and_dms.already_friends',
|
||||
[APIErrorCodes.DIRECT_MESSAGES_DISABLED]: 'friends_and_dms.direct_messages_disabled',
|
||||
[APIErrorCodes.AUDIT_LOG_INDEXING]: 'admin_and_system.audit_log_indexing',
|
||||
[APIErrorCodes.BOTS_CANNOT_CREATE_GUILDS]: 'channels_and_guilds.bots_cannot_create_guilds',
|
||||
[APIErrorCodes.SINGLE_COMMUNITY_CANNOT_CREATE_GUILDS]: 'channels_and_guilds.single_community_cannot_create_guilds',
|
||||
[APIErrorCodes.SINGLE_COMMUNITY_CANNOT_DELETE]: 'channels_and_guilds.single_community_cannot_delete',
|
||||
@@ -34,10 +30,8 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.BLUESKY_OAUTH_AUTHORIZATION_FAILED]: 'connections.bluesky_oauth_authorization_failed',
|
||||
[APIErrorCodes.BLUESKY_OAUTH_CALLBACK_FAILED]: 'connections.bluesky_oauth_callback_failed',
|
||||
[APIErrorCodes.BLUESKY_OAUTH_NOT_ENABLED]: 'connections.bluesky_oauth_not_enabled',
|
||||
[APIErrorCodes.BLUESKY_OAUTH_SESSION_EXPIRED]: 'connections.bluesky_oauth_session_expired',
|
||||
[APIErrorCodes.BLUESKY_OAUTH_STATE_INVALID]: 'connections.bluesky_oauth_state_invalid',
|
||||
[APIErrorCodes.BOT_ALREADY_IN_GUILD]: 'auth_and_oauth.bot_already_in_guild',
|
||||
[APIErrorCodes.BOT_APPLICATION_NOT_FOUND]: 'bots.bot_application_not_found',
|
||||
[APIErrorCodes.BOT_IS_PRIVATE]: 'bots.bot_is_private',
|
||||
[APIErrorCodes.BOT_USER_AUTH_ENDPOINT_ACCESS_DENIED]: 'auth_and_oauth.bot_users_cannot_use_auth_endpoints',
|
||||
[APIErrorCodes.BOT_USER_AUTH_SESSION_CREATION_DENIED]: 'auth_and_oauth.bot_users_cannot_create_auth_sessions',
|
||||
@@ -48,7 +42,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.CANNOT_EXECUTE_ON_DM]: 'channels_and_guilds.cannot_execute_on_dm',
|
||||
[APIErrorCodes.CANNOT_BLOCK_SYSTEM_USER]: 'friends_and_dms.cannot_block_system_user',
|
||||
[APIErrorCodes.CANNOT_MODIFY_SYSTEM_WEBHOOK]: 'webhooks.cannot_modify_system_webhook',
|
||||
[APIErrorCodes.CANNOT_MODIFY_VOICE_STATE]: 'calls_and_voice.cannot_modify_voice_state',
|
||||
[APIErrorCodes.CANNOT_REDEEM_PLUTONIUM_WITH_VISIONARY]: 'premium_and_plans.cannot_redeem_plutonium_with_visionary',
|
||||
[ValidationErrorCodes.ANIMATED_AVATARS_REQUIRE_PREMIUM]: 'premium_and_plans.animated_avatars_require_premium',
|
||||
[ValidationErrorCodes.BANNERS_REQUIRE_PREMIUM]: 'premium_and_plans.banners_require_premium',
|
||||
@@ -68,27 +61,21 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.CANNOT_TRANSFER_OWNERSHIP_TO_BOT]: 'channels_and_guilds.cannot_transfer_ownership_to_bot',
|
||||
[APIErrorCodes.CANNOT_SHRINK_RESERVED_SLOTS]: 'limits.cannot_shrink_reserved_slots',
|
||||
[APIErrorCodes.CAPTCHA_REQUIRED]: 'captcha.required',
|
||||
[APIErrorCodes.CHANNEL_INDEXING]: 'admin_and_system.channel_indexing',
|
||||
[APIErrorCodes.COMMUNICATION_DISABLED]: 'account.communication_disabled',
|
||||
[APIErrorCodes.CONNECTION_ALREADY_EXISTS]: 'connections.already_exists',
|
||||
[APIErrorCodes.CONNECTION_INITIATION_TOKEN_INVALID]: 'connections.initiation_token_invalid',
|
||||
[APIErrorCodes.CONNECTION_INVALID_IDENTIFIER]: 'connections.invalid_identifier',
|
||||
[APIErrorCodes.CONNECTION_INVALID_TYPE]: 'connections.invalid_type',
|
||||
[APIErrorCodes.CONNECTION_LIMIT_REACHED]: 'connections.limit_reached',
|
||||
[APIErrorCodes.CONNECTION_NOT_FOUND]: 'connections.not_found',
|
||||
[APIErrorCodes.CONNECTION_VERIFICATION_FAILED]: 'connections.verification_failed',
|
||||
[APIErrorCodes.CONFLICT]: 'http.conflict',
|
||||
[APIErrorCodes.CONTENT_BLOCKED]: 'content_and_safety.content_blocked',
|
||||
[APIErrorCodes.CREATION_FAILED]: 'admin_and_system.creation_failed',
|
||||
[APIErrorCodes.DECRYPTION_FAILED]: 'admin_and_system.decryption_failed',
|
||||
[APIErrorCodes.DELETION_FAILED]: 'admin_and_system.deletion_failed',
|
||||
[APIErrorCodes.DISCOVERY_ALREADY_APPLIED]: 'discovery.already_applied',
|
||||
[APIErrorCodes.DISCOVERY_APPLICATION_ALREADY_REVIEWED]: 'discovery.application_already_reviewed',
|
||||
[APIErrorCodes.DISCOVERY_APPLICATION_NOT_FOUND]: 'discovery.application_not_found',
|
||||
[APIErrorCodes.DISCOVERY_DESCRIPTION_REQUIRED]: 'discovery.description_required',
|
||||
[APIErrorCodes.DISCOVERY_DISABLED]: 'discovery.disabled',
|
||||
[APIErrorCodes.DISCOVERY_INSUFFICIENT_MEMBERS]: 'discovery.insufficient_members',
|
||||
[APIErrorCodes.DISCOVERY_INVALID_CATEGORY]: 'discovery.invalid_category',
|
||||
[APIErrorCodes.DISCOVERY_NOT_DISCOVERABLE]: 'discovery.not_discoverable',
|
||||
[APIErrorCodes.DISCRIMINATOR_REQUIRED]: 'usernames_and_tags.discriminator_required',
|
||||
[APIErrorCodes.EMAIL_SERVICE_NOT_TESTABLE]: 'email.email_service_not_testable',
|
||||
@@ -102,15 +89,11 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.PURCHASE_EMAIL_VERIFICATION_REQUIRED]: 'account.email_verification_required',
|
||||
[APIErrorCodes.REACTION_EMAIL_VERIFICATION_REQUIRED]: 'account.email_verification_required',
|
||||
[APIErrorCodes.REPORT_EMAIL_VERIFICATION_REQUIRED]: 'account.email_verification_required',
|
||||
[APIErrorCodes.EMPTY_ENCRYPTED_BODY]: 'admin_and_system.empty_encrypted_body',
|
||||
[APIErrorCodes.ENCRYPTION_FAILED]: 'admin_and_system.encryption_failed',
|
||||
[APIErrorCodes.EXPLICIT_CONTENT_CANNOT_BE_SENT]: 'content_and_safety.explicit_content_cannot_be_sent',
|
||||
[APIErrorCodes.FEATURE_NOT_AVAILABLE_SELF_HOSTED]: 'feature_flags.feature_not_available_self_hosted',
|
||||
[APIErrorCodes.FEATURE_TEMPORARILY_DISABLED]: 'feature_flags.feature_temporarily_disabled',
|
||||
[APIErrorCodes.FILE_SIZE_TOO_LARGE]: 'attachments_and_uploads.file_size_too_large',
|
||||
[APIErrorCodes.MESSAGE_TOTAL_ATTACHMENT_SIZE_TOO_LARGE]: 'attachments_and_uploads.file_size_too_large',
|
||||
[APIErrorCodes.FORBIDDEN]: 'http.forbidden',
|
||||
[ValidationErrorCodes.ATTACHMENT_METADATA_WITHOUT_FILES]: 'attachments_and_uploads.attachment_metadata_without_files',
|
||||
[ValidationErrorCodes.ATTACHMENT_ID_NOT_FOUND_IN_MESSAGE]: 'attachments_and_uploads.attachment_not_found_in_message',
|
||||
[ValidationErrorCodes.ATTACHMENT_MUST_BE_IMAGE]: 'attachments_and_uploads.attachment_must_be_image',
|
||||
[ValidationErrorCodes.INVALID_IMAGE_FORMAT]: 'attachments_and_uploads.invalid_image_format',
|
||||
@@ -121,15 +104,12 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.GIFT_CODE_ALREADY_REDEEMED]: 'invites_and_gifts.gift_code_already_redeemed',
|
||||
[APIErrorCodes.GONE]: 'http.gone',
|
||||
[APIErrorCodes.GUILD_PHONE_VERIFICATION_REQUIRED]: 'account.phone_required_for_guild',
|
||||
[APIErrorCodes.GUILD_TEMPLATE_FETCH_FAILED]: 'channels_and_guilds.guild_template_fetch_failed',
|
||||
[APIErrorCodes.GUILD_TEMPLATE_INVALID]: 'channels_and_guilds.guild_template_invalid',
|
||||
[APIErrorCodes.GUILD_VERIFICATION_REQUIRED]: 'account.guild_verification_required',
|
||||
[APIErrorCodes.HANDOFF_CODE_EXPIRED]: 'auth_and_oauth.handoff_code_expired',
|
||||
[APIErrorCodes.HARVEST_EXPIRED]: 'harvest.expired',
|
||||
[APIErrorCodes.HARVEST_FAILED]: 'harvest.failed',
|
||||
[APIErrorCodes.HARVEST_NOT_READY]: 'harvest.not_ready',
|
||||
[APIErrorCodes.HTTP_GET_AUTHORIZE_NOT_SUPPORTED]: 'auth_and_oauth.http_get_authorize_not_supported',
|
||||
[APIErrorCodes.INSTANCE_VERSION_MISMATCH]: 'misc.invalid_request_generic',
|
||||
[APIErrorCodes.INTERNAL_SERVER_ERROR]: 'http.internal_server_error',
|
||||
[APIErrorCodes.INVALID_ACLS_FORMAT]: 'admin_and_system.invalid_acls_format',
|
||||
[APIErrorCodes.INVALID_API_ORIGIN]: 'admin_and_system.invalid_api_origin',
|
||||
@@ -139,22 +119,16 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.INVALID_CHANNEL_TYPE_FOR_CALL]: 'channels_and_guilds.invalid_channel_type_for_call',
|
||||
[APIErrorCodes.INVALID_CHANNEL_TYPE]: 'channels_and_guilds.invalid_channel_type',
|
||||
[ValidationErrorCodes.CHANNEL_NOT_FOUND]: 'channels_and_guilds.channel_not_found',
|
||||
[APIErrorCodes.INVALID_CLIENT]: 'auth_and_oauth.invalid_client',
|
||||
[APIErrorCodes.INVALID_CLIENT_SECRET]: 'auth_and_oauth.invalid_client_secret',
|
||||
[APIErrorCodes.INVALID_DSA_REPORT_TARGET]: 'moderation_and_reports.invalid_dsa_report_target',
|
||||
[APIErrorCodes.INVALID_DSA_TICKET]: 'moderation_and_reports.invalid_dsa_ticket',
|
||||
[APIErrorCodes.INVALID_DSA_VERIFICATION_CODE]: 'moderation_and_reports.invalid_dsa_verification_code',
|
||||
[APIErrorCodes.INVALID_DECRYPTED_JSON]: 'admin_and_system.invalid_decrypted_json',
|
||||
[APIErrorCodes.INVALID_EPHEMERAL_KEY]: 'admin_and_system.invalid_ephemeral_key',
|
||||
[APIErrorCodes.INVALID_FLAGS_FORMAT]: 'admin_and_system.invalid_flags_format',
|
||||
[APIErrorCodes.INVALID_IV]: 'admin_and_system.invalid_iv',
|
||||
[APIErrorCodes.INVALID_FORM_BODY]: 'admin_and_system.invalid_form_body',
|
||||
[ValidationErrorCodes.INVALID_FORMAT]: 'admin_and_system.invalid_format',
|
||||
[ValidationErrorCodes.INVALID_BASE64_FORMAT]: 'admin_and_system.invalid_format',
|
||||
[ValidationErrorCodes.INVALID_EMAIL_FORMAT]: 'email.invalid_format',
|
||||
[ValidationErrorCodes.INVALID_EMAIL_LOCAL_PART]: 'email.invalid_format',
|
||||
[ValidationErrorCodes.EMAIL_DOMAIN_NOT_ALLOWED_FOR_SSO]: 'auth_and_oauth.email_domain_not_allowed_for_sso',
|
||||
[APIErrorCodes.INVALID_GRANT]: 'auth_and_oauth.invalid_grant',
|
||||
[APIErrorCodes.INVALID_HANDOFF_CODE]: 'auth_and_oauth.handoff_code_invalid',
|
||||
[ValidationErrorCodes.INVALID_OR_EXPIRED_AUTHORIZATION_TICKET]:
|
||||
'auth_and_oauth.invalid_or_expired_authorization_ticket',
|
||||
@@ -167,7 +141,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.INVALID_MFA_CODE]: 'mfa_and_passkeys.invalid_mfa_code',
|
||||
[ValidationErrorCodes.INVALID_SSO_AUTHORIZATION_CODE]: 'auth_and_oauth.invalid_sso_authorization_code',
|
||||
[ValidationErrorCodes.INVALID_SSO_TOKEN]: 'auth_and_oauth.invalid_sso_token',
|
||||
[APIErrorCodes.INVALID_REDIRECT_URI]: 'auth_and_oauth.invalid_redirect_uri',
|
||||
[APIErrorCodes.INVALID_REQUEST]: 'misc.invalid_request_generic',
|
||||
[ValidationErrorCodes.STRING_LENGTH_INVALID]: 'limits.string_length_invalid',
|
||||
[ValidationErrorCodes.BASE64_LENGTH_INVALID]: 'limits.base64_length_invalid',
|
||||
@@ -187,11 +160,8 @@ export const ErrorCodeToI18nKey = {
|
||||
'messages.forward_messages_cannot_include_extra_content',
|
||||
[ValidationErrorCodes.FORWARD_REFERENCE_REQUIRES_CHANNEL_AND_MESSAGE]:
|
||||
'messages.forward_reference_requires_channel_and_message',
|
||||
[APIErrorCodes.INVALID_RESPONSE_TYPE_FOR_NON_BOT]: 'bots.invalid_response_type_for_non_bot',
|
||||
[APIErrorCodes.INVALID_SCOPE]: 'auth_and_oauth.invalid_scope',
|
||||
[APIErrorCodes.INVALID_STREAM_KEY_FORMAT]: 'calls_and_voice.invalid_stream_key_format',
|
||||
[APIErrorCodes.INVALID_STREAM_THUMBNAIL_PAYLOAD]: 'calls_and_voice.invalid_stream_thumbnail_payload',
|
||||
[APIErrorCodes.INVALID_SUDO_TOKEN]: 'auth_and_oauth.invalid_sudo_token',
|
||||
[APIErrorCodes.INVALID_SUSPICIOUS_FLAGS_FORMAT]: 'admin_and_system.invalid_suspicious_flags_format',
|
||||
[APIErrorCodes.INVALID_SYSTEM_FLAG]: 'admin_and_system.invalid_system_flag',
|
||||
[APIErrorCodes.INVALID_TIMESTAMP]: 'admin_and_system.invalid_timestamp',
|
||||
@@ -206,8 +176,7 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.IP_AUTHORIZATION_RESEND_LIMIT_EXCEEDED]: 'rate_limits.ip_authorization_resend_limit_exceeded',
|
||||
[APIErrorCodes.GLOBAL_IP_BANNED]: 'permissions.global_ip_banned',
|
||||
[APIErrorCodes.GLOBAL_IP_TEMPORARILY_BANNED]: 'permissions.global_ip_temporarily_banned',
|
||||
[APIErrorCodes.IP_BANNED]: 'permissions.global_ip_banned',
|
||||
[APIErrorCodes.MAX_ANIMATED_EMOJIS]: 'invites_and_packs.max_animated_emojis_reached',
|
||||
[APIErrorCodes.IP_BAN_DECLINED]: 'moderation_and_reports.ip_ban_declined',
|
||||
[APIErrorCodes.MAX_APPLICATIONS]: 'misc_limits.max_applications_reached',
|
||||
[APIErrorCodes.MAX_BOOKMARKS]: 'misc_limits.max_bookmarks_reached',
|
||||
[APIErrorCodes.MAX_CATEGORY_CHANNELS]: 'misc_limits.max_category_channels_reached',
|
||||
@@ -221,14 +190,11 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.MAX_GUILD_MEMBERS]: 'channels_and_guilds.max_guild_members_reached',
|
||||
[APIErrorCodes.MAX_GUILD_ROLES]: 'channels_and_guilds.max_guild_roles_reached',
|
||||
[APIErrorCodes.MAX_GUILDS]: 'channels_and_guilds.max_guilds_reached',
|
||||
[APIErrorCodes.NEW_ACCOUNT_GUILD_JOIN_RATE_LIMITED]: 'channels_and_guilds.new_account_guild_join_rate_limited',
|
||||
[APIErrorCodes.MAX_INVITES]: 'misc_limits.max_invites_reached',
|
||||
[APIErrorCodes.MAX_PINS_PER_CHANNEL]: 'misc_limits.max_pins_per_channel_reached',
|
||||
[APIErrorCodes.MAX_REACTIONS]: 'stickers_and_emojis.max_reactions_reached',
|
||||
[APIErrorCodes.MAX_STICKERS]: 'stickers_and_emojis.max_stickers_reached',
|
||||
[APIErrorCodes.MAX_WEBHOOKS_PER_CHANNEL]: 'webhooks.max_webhooks_per_channel_reached',
|
||||
[APIErrorCodes.MAX_WEBHOOKS_PER_GUILD]: 'webhooks.max_webhooks_per_guild_reached',
|
||||
[APIErrorCodes.MAX_WEBHOOKS]: 'webhooks.max_webhooks_reached',
|
||||
[APIErrorCodes.NCMEC_ALREADY_SUBMITTED]: 'content_and_safety.ncmec_already_submitted',
|
||||
[APIErrorCodes.NCMEC_SUBMISSION_FAILED]: 'content_and_safety.ncmec_submission_failed',
|
||||
[APIErrorCodes.MEDIA_METADATA_ERROR]: 'media_and_memes.media_metadata_error',
|
||||
@@ -238,27 +204,19 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.MISSING_ACCESS]: 'permissions.missing_access',
|
||||
[APIErrorCodes.MISSING_ACL]: 'admin_and_system.missing_acl',
|
||||
[APIErrorCodes.MISSING_AUTHORIZATION]: 'auth_and_oauth.missing_authorization',
|
||||
[APIErrorCodes.MISSING_CLIENT_SECRET]: 'auth_and_oauth.missing_client_secret',
|
||||
[APIErrorCodes.MISSING_EPHEMERAL_KEY]: 'admin_and_system.missing_ephemeral_key',
|
||||
[APIErrorCodes.MISSING_IV]: 'admin_and_system.missing_iv',
|
||||
[APIErrorCodes.MISSING_OAUTH_FIELDS]: 'auth_and_oauth.oauth_fields_missing',
|
||||
[APIErrorCodes.MISSING_OAUTH_SCOPE]: 'auth_and_oauth.invalid_scope',
|
||||
[APIErrorCodes.MISSING_PERMISSIONS]: 'permissions.missing_permissions',
|
||||
[APIErrorCodes.MISSING_REDIRECT_URI]: 'auth_and_oauth.missing_redirect_uri',
|
||||
[APIErrorCodes.NO_ACTIVE_CALL]: 'calls_and_voice.no_active_call',
|
||||
[APIErrorCodes.NO_ACTIVE_SUBSCRIPTION]: 'premium_and_plans.no_active_subscription',
|
||||
[APIErrorCodes.NO_PASSKEYS_REGISTERED]: 'mfa_and_passkeys.no_passkeys_registered',
|
||||
[APIErrorCodes.NO_PENDING_DELETION]: 'misc.invalid_request_generic',
|
||||
[APIErrorCodes.NO_USERS_WITH_FLUXERTAG_EXIST]: 'usernames_and_tags.too_many_users_with_this_username',
|
||||
[APIErrorCodes.NO_VISIONARY_SLOTS_AVAILABLE]: 'premium_and_plans.no_visionary_slots_available',
|
||||
[APIErrorCodes.NOT_A_BOT_APPLICATION]: 'bots.not_a_bot_application',
|
||||
[APIErrorCodes.NOT_FOUND]: 'http.not_found',
|
||||
[APIErrorCodes.NOT_FRIENDS_WITH_USER]: 'friends_and_dms.not_friends',
|
||||
[APIErrorCodes.NOT_IMPLEMENTED]: 'http.not_implemented',
|
||||
[APIErrorCodes.NOT_OWNER_OF_ADMIN_API_KEY]: 'permissions.not_owner_of_admin_api_key',
|
||||
[APIErrorCodes.NSFW_CONTENT_AGE_RESTRICTED]: 'content_and_safety.nsfw_age_restricted',
|
||||
[APIErrorCodes.PASSKEY_AUTHENTICATION_FAILED]: 'mfa_and_passkeys.passkey_authentication_failed',
|
||||
[APIErrorCodes.PASSKEYS_DISABLED]: 'mfa_and_passkeys.passkeys_disabled',
|
||||
[APIErrorCodes.PHONE_ADD_NOT_ELIGIBLE]: 'phone.add_not_eligible',
|
||||
[APIErrorCodes.PHONE_ALREADY_USED]: 'phone.number_already_used',
|
||||
[APIErrorCodes.PHONE_COUNTRY_NOT_SUPPORTED]: 'phone.country_not_supported',
|
||||
@@ -274,7 +232,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.PREVIEW_MUST_BE_JPEG]: 'attachments_and_uploads.preview_must_be_jpeg',
|
||||
[APIErrorCodes.PROCESSING_FAILED]: 'admin_and_system.processing_failed',
|
||||
[APIErrorCodes.RATE_LIMITED]: 'rate_limits.rate_limited',
|
||||
[APIErrorCodes.REDIRECT_URI_REQUIRED_FOR_NON_BOT]: 'auth_and_oauth.redirect_uri_required_for_non_bot_scopes',
|
||||
[APIErrorCodes.REGISTRATION_CLOSED]: 'auth_and_oauth.registration_closed',
|
||||
[APIErrorCodes.REGISTRATION_PENDING_APPROVAL]: 'auth_and_oauth.registration_pending_approval',
|
||||
[APIErrorCodes.REGISTRATION_REJECTED]: 'auth_and_oauth.registration_rejected',
|
||||
@@ -290,7 +247,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.SSO_REQUIRED]: 'misc.invalid_request_generic',
|
||||
[APIErrorCodes.STREAM_KEY_CHANNEL_MISMATCH]: 'calls_and_voice.stream_key_channel_mismatch',
|
||||
[APIErrorCodes.STREAM_KEY_SCOPE_MISMATCH]: 'calls_and_voice.stream_key_scope_mismatch',
|
||||
[APIErrorCodes.STREAM_THUMBNAIL_PAYLOAD_EMPTY]: 'calls_and_voice.stream_thumbnail_payload_empty',
|
||||
[APIErrorCodes.STRIPE_ERROR]: 'stripe.error',
|
||||
[APIErrorCodes.STRIPE_GIFT_REDEMPTION_IN_PROGRESS]: 'invites_and_gifts.stripe_gift_redemption_in_progress',
|
||||
[APIErrorCodes.STRIPE_INVALID_PRODUCT]: 'stripe.invalid_product_selection',
|
||||
@@ -301,10 +257,8 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.STRIPE_REFUND_COOLDOWN_ACTIVE]: 'stripe.refund_cooldown_active',
|
||||
[APIErrorCodes.STRIPE_NO_SUBSCRIPTION]: 'stripe.no_subscription_found',
|
||||
[APIErrorCodes.STRIPE_PAYMENT_NOT_AVAILABLE]: 'stripe.payment_not_available',
|
||||
[APIErrorCodes.EU_WITHDRAWAL_WAIVER_REQUIRED]: 'stripe.eu_withdrawal_waiver_required',
|
||||
[APIErrorCodes.STRIPE_SUBSCRIPTION_ALREADY_CANCELING]: 'stripe.subscription_already_canceling',
|
||||
[APIErrorCodes.STRIPE_SUBSCRIPTION_NOT_CANCELING]: 'stripe.subscription_not_canceling',
|
||||
[APIErrorCodes.STRIPE_SUBSCRIPTION_PERIOD_END_MISSING]: 'stripe.subscription_period_end_missing',
|
||||
[APIErrorCodes.STRIPE_WEBHOOK_NOT_AVAILABLE]: 'stripe.webhook_not_available',
|
||||
[APIErrorCodes.STRIPE_WEBHOOK_SIGNATURE_INVALID]: 'stripe.webhook_signature_invalid',
|
||||
[APIErrorCodes.STRIPE_WEBHOOK_SIGNATURE_MISSING]: 'stripe.webhook_signature_missing',
|
||||
@@ -312,7 +266,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.DONATION_MAGIC_LINK_EXPIRED]: 'donation.magic_link_expired',
|
||||
[APIErrorCodes.DONATION_MAGIC_LINK_INVALID]: 'donation.magic_link_invalid',
|
||||
[APIErrorCodes.DONATION_MAGIC_LINK_USED]: 'donation.magic_link_used',
|
||||
[APIErrorCodes.DONOR_NOT_FOUND]: 'donation.donor_not_found',
|
||||
[APIErrorCodes.SUDO_MODE_REQUIRED]: 'auth_and_oauth.sudo_mode_required',
|
||||
[APIErrorCodes.TAG_ALREADY_TAKEN]: 'usernames_and_tags.tag_already_taken',
|
||||
[APIErrorCodes.TEMPORARY_INVITE_REQUIRES_PRESENCE]: 'channels_and_guilds.temporary_invite_requires_presence',
|
||||
@@ -354,8 +307,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.UNKNOWN_WEBAUTHN_CREDENTIAL]: 'mfa_and_passkeys.unknown_webauthn_credential',
|
||||
[APIErrorCodes.UNKNOWN_APPLICATION]: 'auth_and_oauth.unknown_application',
|
||||
[APIErrorCodes.UNKNOWN_WEBHOOK]: 'webhooks.unknown_webhook',
|
||||
[APIErrorCodes.UNFURL_STREAM_TOO_LARGE]: 'urls.unfurl_stream_too_large',
|
||||
[APIErrorCodes.UNSUPPORTED_RESPONSE_TYPE]: 'auth_and_oauth.unsupported_response_type',
|
||||
[APIErrorCodes.UPDATE_FAILED]: 'admin_and_system.update_failed',
|
||||
[APIErrorCodes.USERNAME_NOT_AVAILABLE]: 'usernames_and_tags.username_not_available',
|
||||
[APIErrorCodes.USER_BANNED_FROM_GUILD]: 'permissions.user_banned_from_guild',
|
||||
@@ -365,7 +316,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[APIErrorCodes.VOICE_CHANNEL_FULL]: 'channels_and_guilds.voice_channel_full',
|
||||
[APIErrorCodes.WEBAUTHN_CREDENTIAL_LIMIT_REACHED]: 'mfa_and_passkeys.webauthn_credential_limit_reached',
|
||||
[APIErrorCodes.AGE_VERIFICATION_ALREADY_VERIFIED]: 'age_verification.already_verified',
|
||||
[APIErrorCodes.AGE_VERIFICATION_INVALID_CARD_TYPE]: 'age_verification.invalid_card_type',
|
||||
[ValidationErrorCodes.MESSAGE_IDS_CANNOT_BE_EMPTY]: 'messages.message_ids_cannot_be_empty',
|
||||
[ValidationErrorCodes.MESSAGES_ARRAY_REQUIRED_AND_NOT_EMPTY]: 'messages.messages_array_required',
|
||||
[ValidationErrorCodes.MESSAGES_WITH_SNAPSHOTS_CANNOT_BE_EDITED]: 'messages.messages_with_snapshots_cannot_be_edited',
|
||||
@@ -387,11 +337,9 @@ export const ErrorCodeToI18nKey = {
|
||||
'calls_and_voice.voice_messages_require_single_attachment',
|
||||
[ValidationErrorCodes.MUST_START_SESSION_BEFORE_SENDING]: 'auth_and_oauth.must_start_session_before_sending_messages',
|
||||
[ValidationErrorCodes.TOO_MANY_EMBEDS]: 'embeds.too_many_embeds',
|
||||
[ValidationErrorCodes.ATTACHMENTS_METADATA_REQUIRED_WHEN_UPLOADING]:
|
||||
'attachments_and_uploads.attachments_metadata_required_when_uploading',
|
||||
[ValidationErrorCodes.TOO_LARGE]: 'limits.synced_preferences_too_large',
|
||||
[ValidationErrorCodes.CANNOT_REFERENCE_ATTACHMENTS_WITHOUT_ATTACHMENTS]:
|
||||
'attachments_and_uploads.cannot_reference_attachments_without_attachments',
|
||||
[ValidationErrorCodes.NO_METADATA_FOR_FILE]: 'attachments_and_uploads.no_metadata_for_file',
|
||||
[ValidationErrorCodes.NO_FILE_FOR_ATTACHMENT]: 'attachments_and_uploads.no_file_uploaded_for_attachment',
|
||||
[ValidationErrorCodes.NO_FILE_FOR_ATTACHMENT_METADATA]:
|
||||
'attachments_and_uploads.no_file_uploaded_for_attachment_metadata',
|
||||
@@ -406,31 +354,24 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.DUPLICATE_FILE_INDEX]: 'attachments_and_uploads.duplicate_file_index',
|
||||
[ValidationErrorCodes.FAILED_TO_PARSE_MULTIPART_FORM_DATA]:
|
||||
'attachments_and_uploads.failed_to_parse_multipart_form_data',
|
||||
[ValidationErrorCodes.FAILED_TO_PARSE_MULTIPART_PAYLOAD]: 'attachments_and_uploads.failed_to_parse_multipart_payload',
|
||||
[ValidationErrorCodes.FAILED_TO_FETCH_SSO_USER_INFO]: 'auth_and_oauth.failed_to_fetch_sso_user_info',
|
||||
[ValidationErrorCodes.FAILED_TO_PARSE_SSO_USER_INFO]: 'auth_and_oauth.failed_to_parse_sso_user_info',
|
||||
[ValidationErrorCodes.FAILED_TO_UPLOAD_IMAGE]: 'attachments_and_uploads.failed_to_upload_image',
|
||||
[ValidationErrorCodes.FILE_INDEX_EXCEEDS_MAXIMUM]: 'attachments_and_uploads.file_index_exceeds_maximum',
|
||||
[ValidationErrorCodes.FILE_NOT_FOUND]: 'attachments_and_uploads.file_not_found',
|
||||
[ValidationErrorCodes.FILE_NOT_FOUND_FOR_SCANNING]: 'attachments_and_uploads.file_not_found_for_scanning',
|
||||
[ValidationErrorCodes.FILENAME_EMPTY_AFTER_NORMALIZATION]:
|
||||
'attachments_and_uploads.filename_empty_after_normalization',
|
||||
[ValidationErrorCodes.FILENAME_INVALID_CHARACTERS]: 'attachments_and_uploads.filename_invalid_characters',
|
||||
[ValidationErrorCodes.FILENAME_LENGTH_INVALID]: 'attachments_and_uploads.filename_length_invalid',
|
||||
[ValidationErrorCodes.FILENAME_MISMATCH_FOR_ATTACHMENT]: 'attachments_and_uploads.filename_mismatch_for_attachment',
|
||||
[ValidationErrorCodes.IMAGE_SIZE_EXCEEDS_LIMIT]: 'attachments_and_uploads.image_size_exceeds_limit',
|
||||
[ValidationErrorCodes.INVALID_FILE_FIELD_NAME]: 'attachments_and_uploads.invalid_file_field_name',
|
||||
[ValidationErrorCodes.INVALID_IMAGE_DATA]: 'attachments_and_uploads.invalid_image_data',
|
||||
[ValidationErrorCodes.INVALID_URL_FORMAT]: 'urls.invalid_url_format',
|
||||
[ValidationErrorCodes.INVALID_URL_OR_ATTACHMENT_FORMAT]: 'urls.invalid_url_or_attachment_reference',
|
||||
[ValidationErrorCodes.MULTIPLE_FILES_FOR_INDEX_NOT_ALLOWED]:
|
||||
'attachments_and_uploads.multiple_files_for_index_not_allowed',
|
||||
[ValidationErrorCodes.NO_VALID_MEDIA_IN_MESSAGE]: 'attachments_and_uploads.no_valid_media_in_message',
|
||||
[ValidationErrorCodes.PAYLOAD_JSON_REQUIRED_FOR_MULTIPART]:
|
||||
'attachments_and_uploads.payload_json_required_for_multipart',
|
||||
[ValidationErrorCodes.SIZE_BYTES_MUST_BE_VALID_INTEGER]: 'attachments_and_uploads.size_bytes_must_be_valid_integer',
|
||||
[ValidationErrorCodes.TOO_MANY_FILES]: 'attachments_and_uploads.too_many_files',
|
||||
[ValidationErrorCodes.UNKNOWN_IMAGE_FORMAT]: 'attachments_and_uploads.unknown_image_format',
|
||||
[ValidationErrorCodes.UNRESOLVED_ATTACHMENT_URL]: 'attachments_and_uploads.unresolved_attachment_url',
|
||||
[ValidationErrorCodes.UPLOADED_ATTACHMENT_NOT_FOUND]: 'attachments_and_uploads.uploaded_attachment_not_found',
|
||||
[ValidationErrorCodes.URL_LENGTH_INVALID]: 'urls.url_length_invalid',
|
||||
@@ -458,8 +399,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.USERNAME_INVALID_CHARACTERS]: 'usernames_and_tags.username_invalid_characters',
|
||||
[ValidationErrorCodes.USERNAME_LENGTH_INVALID]: 'usernames_and_tags.username_length_invalid',
|
||||
[ValidationErrorCodes.USERNAME_RESERVED_VALUE]: 'usernames_and_tags.username_reserved_value',
|
||||
[ValidationErrorCodes.VISIONARY_REQUIRED_FOR_BOT_DISCRIMINATOR]:
|
||||
'premium_and_plans.visionary_required_for_bot_discriminator',
|
||||
[ValidationErrorCodes.VISIONARY_REQUIRED_FOR_DISCRIMINATOR]: 'premium_and_plans.visionary_required_for_discriminator',
|
||||
[ValidationErrorCodes.BOT_DISCRIMINATOR_CANNOT_BE_CHANGED]: 'bots.bot_discriminator_cannot_be_changed',
|
||||
[ValidationErrorCodes.BOT_SEARCH_SCOPE_UNAVAILABLE]: 'bots.search_scope_unavailable',
|
||||
@@ -468,7 +407,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.USER_IS_NOT_BANNED]: 'moderation_and_reports.user_is_not_banned',
|
||||
[ValidationErrorCodes.NCMEC_ATTACHMENT_MUST_BE_IMAGE_OR_VIDEO]:
|
||||
'moderation_and_reports.ncmec_attachment_must_be_image_or_video',
|
||||
[ValidationErrorCodes.ACCOUNT_ALREADY_VERIFIED]: 'account.already_verified',
|
||||
[ValidationErrorCodes.EMAIL_ALREADY_IN_USE]: 'email.email_already_in_use',
|
||||
[ValidationErrorCodes.EMAIL_IS_REQUIRED]: 'email.email_required',
|
||||
[ValidationErrorCodes.EMAIL_LENGTH_INVALID]: 'email.length_invalid',
|
||||
@@ -493,7 +431,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.ORIGINAL_EMAIL_ALREADY_VERIFIED]: 'email.original_email_already_verified',
|
||||
[ValidationErrorCodes.ORIGINAL_EMAIL_MUST_BE_VERIFIED_FIRST]: 'email.original_email_must_be_verified_first',
|
||||
[ValidationErrorCodes.ORIGINAL_VERIFICATION_NOT_REQUIRED]: 'email.original_verification_not_required',
|
||||
[ValidationErrorCodes.INVALID_CURRENT_PASSWORD]: 'auth_and_registration.current_password_incorrect',
|
||||
[ValidationErrorCodes.PASSWORD_IS_TOO_COMMON]: 'auth_and_registration.password_is_too_common',
|
||||
[ValidationErrorCodes.PASSWORD_NOT_SET]: 'auth_and_registration.password_not_set',
|
||||
[ValidationErrorCodes.SESSION_TIMEOUT]: 'account.session_timeout',
|
||||
@@ -524,11 +461,11 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.CATEGORIES_CANNOT_HAVE_PARENTS]: 'channels_and_guilds.categories_cannot_have_parents',
|
||||
[ValidationErrorCodes.AFK_CHANNEL_MUST_BE_IN_GUILD]: 'channels_and_guilds.afk_channel_must_be_in_guild',
|
||||
[ValidationErrorCodes.AFK_CHANNEL_MUST_BE_VOICE]: 'channels_and_guilds.afk_channel_must_be_voice',
|
||||
[ValidationErrorCodes.AGE_RESTRICTED]: 'account.sensitive_content_filter_age_restricted',
|
||||
[ValidationErrorCodes.ALL_CHANNELS_MUST_BELONG_TO_GUILD]: 'channels_and_guilds.all_channels_must_belong_to_guild',
|
||||
[ValidationErrorCodes.CANNOT_POSITION_CHANNEL_RELATIVE_TO_ITSELF]:
|
||||
'channels_and_guilds.cannot_position_channel_relative_to_itself',
|
||||
[ValidationErrorCodes.CANNOT_SPECIFY_BOTH_BEFORE_AND_AFTER]: 'limits.cannot_specify_before_and_after',
|
||||
[ValidationErrorCodes.INVALID_CHANNEL]: 'channels_and_guilds.invalid_channel',
|
||||
[ValidationErrorCodes.INVALID_CHANNEL_ID]: 'channels_and_guilds.invalid_channel_id',
|
||||
[ValidationErrorCodes.INVALID_PARENT_CHANNEL]: 'channels_and_guilds.invalid_parent_channel',
|
||||
[ValidationErrorCodes.PARENT_CHANNEL_NOT_IN_GUILD]: 'channels_and_guilds.parent_channel_not_in_guild',
|
||||
@@ -553,8 +490,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.FAVORITE_MEME_NAME_REQUIRED]: 'media_and_memes.favorite_meme_name_required',
|
||||
[ValidationErrorCodes.FAVORITE_MEME_NOT_FOUND]: 'media_and_memes.favorite_meme_not_found',
|
||||
[ValidationErrorCodes.CANNOT_SET_HOIST_FOR_EVERYONE_ROLE]: 'roles.cannot_set_everyone_hoist',
|
||||
[ValidationErrorCodes.CANNOT_USE_SAME_ROLE_AS_PRECEDING]: 'roles.cannot_use_same_role_as_preceding',
|
||||
[ValidationErrorCodes.PRECEDING_ROLE_NOT_IN_GUILD]: 'roles.preceding_role_not_in_guild',
|
||||
[ValidationErrorCodes.PARSE_AND_USERS_OR_ROLES_CANNOT_BE_USED_TOGETHER]:
|
||||
'roles.parse_and_users_or_roles_cannot_be_used_together',
|
||||
[ValidationErrorCodes.ANIMATED_GUILD_BANNER_REQUIRES_FEATURE]:
|
||||
@@ -581,7 +516,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.INVALID_DATE_OF_BIRTH_FORMAT]: 'tos_and_age.date_of_birth_format_invalid',
|
||||
[ValidationErrorCodes.INVALID_INTEGER_FORMAT]: 'admin_and_system.invalid_integer_format',
|
||||
[ValidationErrorCodes.INVALID_ISO_TIMESTAMP]: 'admin_and_system.must_be_iso_timestamp',
|
||||
[ValidationErrorCodes.INVALID_JOB_ID]: 'misc.invalid_job_id',
|
||||
[ValidationErrorCodes.INVALID_JSON_IN_PAYLOAD_JSON]: 'attachments_and_uploads.invalid_json_in_payload_json',
|
||||
[ValidationErrorCodes.INVALID_OR_RESTRICTED_RTC_REGION]: 'calls_and_voice.invalid_or_restricted_rtc_region',
|
||||
[ValidationErrorCodes.INVALID_RTC_REGION]: 'calls_and_voice.invalid_rtc_region',
|
||||
@@ -589,9 +523,7 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.INVALID_SNOWFLAKE_FORMAT]: 'misc.invalid_snowflake',
|
||||
[ValidationErrorCodes.INVALID_TIMEOUT_VALUE]: 'admin_and_system.invalid_timeout_value',
|
||||
[ValidationErrorCodes.INVALID_TIMEZONE_IDENTIFIER]: 'admin_and_system.invalid_timezone_identifier',
|
||||
[ValidationErrorCodes.JOB_ID_IS_REQUIRED]: 'misc.job_id_required',
|
||||
[ValidationErrorCodes.JOB_IS_ALREADY_PROCESSED]: 'misc.job_already_processed',
|
||||
[ValidationErrorCodes.JOB_NOT_FOUND]: 'misc.job_not_found',
|
||||
[ValidationErrorCodes.INVALID_TRUSTED_DOMAINS]: 'account.trusted_domains_wildcard_conflict',
|
||||
[ValidationErrorCodes.MUST_ENABLE_2FA_BEFORE_REQUIRING_FOR_MODS]:
|
||||
'mfa_and_passkeys.must_enable_2fa_before_enforcing_for_mods',
|
||||
[ValidationErrorCodes.TOTP_NOT_ENABLED]: 'mfa_and_passkeys.totp_not_enabled',
|
||||
@@ -603,7 +535,6 @@ export const ErrorCodeToI18nKey = {
|
||||
[ValidationErrorCodes.TICKET_ALREADY_COMPLETED]: 'tickets.ticket_already_completed',
|
||||
[ValidationErrorCodes.TIMEOUT_CANNOT_EXCEED_365_DAYS]: 'limits.timeout_cannot_exceed_365_days',
|
||||
[ValidationErrorCodes.VALUE_MUST_BE_INTEGER_IN_RANGE]: 'limits.value_must_be_integer_in_range',
|
||||
[ValidationErrorCodes.VALUE_TOO_SMALL]: 'limits.value_too_small',
|
||||
[APIErrorCodes.VALIDATION_ERROR]: 'http.validation_error',
|
||||
[ValidationErrorCodes.ENTRANCE_SOUND_INVALID_FORMAT]: 'entrance_sounds.invalid_format',
|
||||
[ValidationErrorCodes.ENTRANCE_SOUND_DURATION_EXCEEDS_LIMIT]: 'entrance_sounds.duration_exceeds_limit',
|
||||
|
||||
Reference in new issue
Block a user