From 88efb71c7a0f61089b1a26f5a43b3a197afd69bc Mon Sep 17 00:00:00 2001 From: Julia Ilasova <1julka1il@gmail.com> Date: Thu, 25 Apr 2024 10:53:17 +0200 Subject: [PATCH] . --- Tests/TestBase.cs | 1 + api/GlobalExceptionHandler.cs | 3 ++- api/Program.cs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/TestBase.cs b/Tests/TestBase.cs index 9260a42..981af66 100644 --- a/Tests/TestBase.cs +++ b/Tests/TestBase.cs @@ -35,6 +35,7 @@ await webSocketTestClient.DoAndAssert(new ClientWantsToSignUpDto { RegisterUserD var jwtSubscription = webSocketTestClient.Client.MessageReceived.Subscribe(msg => { + Console.WriteLine(msg.Text); var serverAuthenticates = JsonSerializer.Deserialize(msg.Text, options: new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); jwt = serverAuthenticates.Jwt; }); diff --git a/api/GlobalExceptionHandler.cs b/api/GlobalExceptionHandler.cs index daf0e3f..cd88b61 100644 --- a/api/GlobalExceptionHandler.cs +++ b/api/GlobalExceptionHandler.cs @@ -27,7 +27,8 @@ public static void Handle(this Exception ex, IWebSocketConnection socket, string else serverResponse = new ServerSendsErrorMessage { - Error = "Something went wrong. Please try again later." + // TODO: revert Error = "Something went wrong. Please try again later." + Error = message ?? ex.Message }; socket.SendDto(serverResponse); diff --git a/api/Program.cs b/api/Program.cs index 64793b3..77dfb40 100644 --- a/api/Program.cs +++ b/api/Program.cs @@ -53,7 +53,8 @@ public static async Task StartApi(string[] args) await dbContainer.StartAsync(); - var connectionString = dbContainer.GetConnectionString(); + var connectionString = dbContainer.GetConnectionString() + ";Include Error Detail=true;"; + Console.WriteLine(connectionString); builder.Services.AddDbContextFactory(options => { options.UseNpgsql(connectionString ?? throw new Exception("Connection string cannot be null"));