Skip to content

Commit

Permalink
Enrich the error message more
Browse files Browse the repository at this point in the history
  • Loading branch information
Sella-GH committed Jan 19, 2025
1 parent 5d339fc commit cc4c577
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AzzyBot.Bot/Services/Modules/AzuraCastPingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public sealed class AzuraCastPingService(ILogger<AzuraCastPingService> logger, A
private readonly AzuraCastApiService _azuraCast = azuraCast;
private readonly DbActions _dbActions = dbActions;
private readonly DiscordBotService _botService = discordBotService;
private const string ValidCertNeeded = "The certificate for AzuraCast instance **URI** is self-signed and therefore not valid!\nYou need a valid HTTPS certificate for your AzuraCast instance so AzzyBot can safely connect to it.";

public async Task PingInstanceAsync(AzuraCastEntity azuraCast)
{
Expand All @@ -36,7 +37,7 @@ public async Task PingInstanceAsync(AzuraCastEntity azuraCast)
if (ex.InnerException is AuthenticationException)
{
_logger.BackgroundServiceInstanceStatus(azuraCast.GuildId, azuraCast.Id, "invalid because of a self-signed certificate");
message = $"The certificate for AzuraCast instance **{uri}** is self-signed and therefore not valid!";
message = ValidCertNeeded.Replace("**URI**", uri.ToString(), StringComparison.OrdinalIgnoreCase);
}
else
{
Expand Down

0 comments on commit cc4c577

Please sign in to comment.