refactor: enhance error logging and add installment amount to institution contract view model

This commit is contained in:
2025-12-27 10:26:12 +03:30
parent a986212834
commit c488f61a09
3 changed files with 48 additions and 13 deletions

View File

@@ -24,9 +24,13 @@ public class CustomExceptionHandler : IExceptionHandler
public async ValueTask<bool> TryHandleAsync(HttpContext context, Exception exception, CancellationToken cancellationToken)
{
_logger.LogError(
"Error Message: {exceptionMessage}, Time of occurrence {time}",
exception.Message, DateTime.UtcNow);
_logger.LogError(exception,
"Error Message: {exceptionMessage}, Type: {exceptionType}, Time: {time}, Path: {path}, TraceId: {traceId}",
exception.Message,
exception.GetType().FullName,
DateTime.UtcNow,
context.Request.Path,
context.TraceIdentifier);
(string Detail, string Title, int StatusCode, Dictionary<string, object>? Extra) details = exception switch
{