fix(notifications): improve error handling for Telegram test by logging detailed error message

This commit is contained in:
Yusuf İpek
2026-04-10 21:53:56 +03:00
parent 05a303cd35
commit 11abb5dbcb
+2 -2
View File
@@ -154,8 +154,8 @@ export async function POST(request: NextRequest) {
if (!res.ok) { if (!res.ok) {
const data = await res.json().catch(() => ({})); const data = await res.json().catch(() => ({}));
const desc = (data as { description?: string }).description || 'Unknown error'; logError('Telegram test failed:', (data as { description?: string }).description);
return apiErrors.badRequest(`Telegram test failed: ${desc}`); return apiErrors.badRequest('Telegram test failed: check that the Chat ID is correct and the bot has been started');
} }
const response = successResponse({ message: 'Test message sent to Telegram' }); const response = successResponse({ message: 'Test message sent to Telegram' });