using Microsoft.AspNetCore.Diagnostics; namespace IdentityShroud.Api; public class GlobalExceptionHandler : IExceptionHandler { private readonly ILogger _logger; public GlobalExceptionHandler(ILogger logger) => _logger = logger; public async ValueTask TryHandleAsync( HttpContext httpContext, Exception exception, CancellationToken cancellationToken) { _logger.LogError(exception, "Exception type: {Type}, Message: {Message}", exception.GetType().Name, exception.Message); // Return false to let other handlers or the default handle it // Return true to mark it as handled return false; } }