mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
fix(notifications): improve error handling for Telegram test by logging detailed error message
This commit is contained in:
@@ -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' });
|
||||||
|
|||||||
Reference in New Issue
Block a user