about summary refs log tree commit diff
path: root/Utilities/LibMatrix.HomeserverEmulator/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-02-03 19:06:08 +0100
committerRory& <root@rory.gay>2025-02-03 19:06:08 +0100
commit040c244d35ff42b59993c85a5110d4e7aedc0237 (patch)
treed3d42436cc40a2f09b8dec87624ef45ea9acd2d7 /Utilities/LibMatrix.HomeserverEmulator/Program.cs
parentThe rest of warning cleanup so far. (diff)
downloadLibMatrix-040c244d35ff42b59993c85a5110d4e7aedc0237.tar.xz
Some code cleanup
Diffstat (limited to '')
-rw-r--r--Utilities/LibMatrix.HomeserverEmulator/Program.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/LibMatrix.HomeserverEmulator/Program.cs b/Utilities/LibMatrix.HomeserverEmulator/Program.cs

index 0a50c80..c72df5a 100644 --- a/Utilities/LibMatrix.HomeserverEmulator/Program.cs +++ b/Utilities/LibMatrix.HomeserverEmulator/Program.cs
@@ -31,7 +31,7 @@ builder.Services.AddSwaggerGen(c => { }); builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); -builder.Services.AddSingleton<HSEConfiguration>(); +builder.Services.AddSingleton<HseConfiguration>(); builder.Services.AddSingleton<UserStore>(); builder.Services.AddSingleton<RoomStore>(); builder.Services.AddSingleton<MediaStore>(); @@ -76,7 +76,7 @@ app.UseExceptionHandler(exceptionHandlerApp => { var exceptionHandlerPathFeature = context.Features.Get<IExceptionHandlerPathFeature>(); if (exceptionHandlerPathFeature?.Error is not null) - Console.WriteLine(exceptionHandlerPathFeature.Error.ToString()!); + Console.WriteLine(exceptionHandlerPathFeature.Error.ToString()); if (exceptionHandlerPathFeature?.Error is MatrixException mxe) { context.Response.StatusCode = mxe.ErrorCode switch { @@ -85,14 +85,14 @@ app.UseExceptionHandler(exceptionHandlerApp => { _ => StatusCodes.Status500InternalServerError }; context.Response.ContentType = MediaTypeNames.Application.Json; - await context.Response.WriteAsync(mxe.GetAsJson()!); + await context.Response.WriteAsync(mxe.GetAsJson()); } else { context.Response.StatusCode = StatusCodes.Status500InternalServerError; context.Response.ContentType = MediaTypeNames.Application.Json; await context.Response.WriteAsync(new MatrixException() { ErrorCode = "M_UNKNOWN", - Error = exceptionHandlerPathFeature?.Error.ToString() + Error = exceptionHandlerPathFeature?.Error?.ToString() ?? "Unknown error" }.GetAsJson()); } });