Refactor ResultController ctor, enhance BadRequest logging

Removed IConfiguration from ResultController constructor, now only using IMediator. Added logging for BadRequestException inner exceptions in ExceptionHandlingMiddleware for improved error diagnostics.
This commit is contained in:
Developer 02
2026-01-21 22:24:41 +01:00
parent 86f4e3141e
commit c7e366af60
2 changed files with 8 additions and 1 deletions

View File

@@ -63,6 +63,13 @@ public class ExceptionHandlingMiddleware
switch (exception)
{
case BadRequestException badRequestEx:
if (badRequestEx.InnerException is not null)
{
logger.LogError(
badRequestEx.InnerException,
"BadRequestException inner exception captured.");
}
context.Response.StatusCode = (int)HttpStatusCode.BadRequest;
details = new()
{