refactor: error logging
This commit is contained in:
parent
6c20713d81
commit
8fad070a9c
@ -56,7 +56,7 @@ public class CustomExceptionHandlerMiddleware(RequestDelegate next, ILogger<Cust
|
|||||||
if (code == StatusCodes.Status500InternalServerError)
|
if (code == StatusCodes.Status500InternalServerError)
|
||||||
{
|
{
|
||||||
error = "Internal Server Error";
|
error = "Internal Server Error";
|
||||||
logger.LogError("Internal server error: {Message}\nStackTrace:\n{StackTrace}", exception.Message, exception.StackTrace);
|
logger.LogError(exception, "Internal server error when processing the request");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error = exception.Message;
|
error = exception.Message;
|
||||||
|
Loading…
Reference in New Issue
Block a user