Skip to content

Commit 582c232

Browse files
Telegram message.
1 parent ea8c79b commit 582c232

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

backend/src/Notifo.Domain.Integrations/Discord/DiscordIntegration.cs

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public Task<IntegrationStatus> OnConfiguredAsync(IntegrationContext context, Int
4949
CancellationToken ct)
5050
{
5151
var botToken = BotToken.GetString(context.Properties);
52-
5352
try
5453
{
5554
TokenUtils.ValidateToken(TokenType.Bot, botToken);

backend/src/Notifo.Domain.Integrations/Telegram/TelegramIntegration.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// ==========================================================================
77

88
using Notifo.Domain.Integrations.Resources;
9+
using Notifo.Infrastructure.Validation;
910
using Telegram.Bot;
1011

1112
namespace Notifo.Domain.Integrations.Telegram;
@@ -54,7 +55,14 @@ public sealed partial class TelegramIntegration(TelegramBotClientPool clientPool
5455
public async Task<IntegrationStatus> OnConfiguredAsync(IntegrationContext context, IntegrationConfiguration? previous,
5556
CancellationToken ct)
5657
{
57-
await GetBotClient(context).SetWebhookAsync(context.WebhookUrl, cancellationToken: ct);
58+
try
59+
{
60+
await GetBotClient(context).SetWebhookAsync(context.WebhookUrl, cancellationToken: ct);
61+
}
62+
catch (Exception ex)
63+
{
64+
throw new ValidationException($"Failed to configure telegram: {ex.Message}.");
65+
}
5866

5967
return IntegrationStatus.Verified;
6068
}

0 commit comments

Comments
 (0)