From e556de927015acd8d9934e68707a95901acfad8e Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 15 Jun 2026 10:35:47 +1000 Subject: v0.18a --- ExceptionMiddleware.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ExceptionMiddleware.cs') diff --git a/ExceptionMiddleware.cs b/ExceptionMiddleware.cs index 29d0e10..ba4049a 100644 --- a/ExceptionMiddleware.cs +++ b/ExceptionMiddleware.cs @@ -23,16 +23,16 @@ public sealed class ExceptionMiddleware { e.GetType().GetCustomAttribute()?.StatusCode ?? StatusCodes.Status500InternalServerError; - await context.Response.WriteAsJsonAsync(e); + context.Response.Clear(); - var x = 1; + await context.Response.WriteAsJsonAsync(e); } catch(Exception) { context.Response.StatusCode = StatusCodes.Status500InternalServerError; context.Response.ContentType = "application/json"; context.Response.Clear(); - await context.Response.WriteAsync(string.Empty); + await context.Response.WriteAsJsonAsync(new ServerException()); } } } -- cgit v1.3