From de3ca32aa9fb7108061763a768aa56f1e85c772f Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 24 Jan 2024 04:16:13 +0100 Subject: [PATCH] Update TODOs --- Iceshrimp.Backend/Core/Middleware/ErrorHandlerMiddleware.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Iceshrimp.Backend/Core/Middleware/ErrorHandlerMiddleware.cs b/Iceshrimp.Backend/Core/Middleware/ErrorHandlerMiddleware.cs index a90fc5fa..7e499a46 100644 --- a/Iceshrimp.Backend/Core/Middleware/ErrorHandlerMiddleware.cs +++ b/Iceshrimp.Backend/Core/Middleware/ErrorHandlerMiddleware.cs @@ -30,6 +30,7 @@ public class ErrorHandlerMiddleware(RequestDelegate next) { Message = e.Message, RequestId = ctx.TraceIdentifier }); + //TODO: use the overload that takes an exception instead of printing it ourselves logger.LogError("Request {id} encountered an unexpected error: {exception}", ctx.TraceIdentifier, e.ToString()); } @@ -38,6 +39,7 @@ public class ErrorHandlerMiddleware(RequestDelegate next) { } //TODO: Find a better name for this class +//TODO: is there a better way to resolve the originating class than passing the logger? Maybe CustomException, or reflection public class CustomException(HttpStatusCode statusCode, string error, string message, ILogger? logger) : Exception(message) { public readonly string Error = error;