Changes on messages

This commit is contained in:
2026-03-28 21:26:45 +01:00
parent 4fa341d2c8
commit 2518101a52
25 changed files with 153 additions and 179 deletions
@@ -1,4 +1,4 @@
using Ardalis.Result;
using Ardalis.Result;
using Keycloak.Net;
using Keycloak.Net.Models.Users;
using Microsoft.Extensions.Logging;
@@ -23,12 +23,12 @@ namespace Musify.Infrastructure.Identity
}
catch (OperationCanceledException)
{
logger.LogError("Operation to retrieve Keycloak user with id={KeycloakId} was cancelled.", keycloakId);
return Result.Error("Operation was cancelled.");
logger.LogWarning("Operation to retrieve Keycloak user {KeycloakId} was cancelled", keycloakId);
return Result.Error("Operation cancelled");
}
catch (Exception exception)
{
logger.LogWarning(exception, "Keycloak user with id={KeycloakId} could not be retrieved.", keycloakId);
logger.LogWarning(exception, "Failed to retrieve Keycloak user {KeycloakId}", keycloakId);
return Result.NotFound();
}
return Result.Success(KeycloakUserMapper.Map(keycloakUser));