From b56992a995f7694f4db2ab85ff892372c62b0faf Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 21 Aug 2025 18:48:41 +0300 Subject: [PATCH] fix(registration): improve error handling for customer creation - Updated error handling in the registration feature to return a generic error message when documentId is not present, enhancing user experience by providing clearer feedback. --- apps/bot/src/bot/features/registration.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/bot/src/bot/features/registration.ts b/apps/bot/src/bot/features/registration.ts index 3e2bf5e..745de66 100644 --- a/apps/bot/src/bot/features/registration.ts +++ b/apps/bot/src/bot/features/registration.ts @@ -60,9 +60,7 @@ feature.on(':contact', logHandle('contact-registration'), async (ctx) => { const response = await registrationService.createCustomer({ name, phone, telegramId }); const documentId = response?.createCustomer?.documentId; - if (!documentId) { - throw new Error('Не удалось создать клиента: отсутствует documentId'); - } + if (!documentId) return ctx.reply(ctx.t('err-generic')); await registrationService.updateCustomer({ data: { active: true },