a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/startup] Improve database connection error logging

Since CanConnectAsync swallows all errors, we want to give instance operators more information for debugging when the database connection fails.

+13
+13
Iceshrimp.Backend/Core/Extensions/WebApplicationExtensions.cs
··· 125 125 } 126 126 127 127 app.Logger.LogInformation("Verifying database connection..."); 128 + 128 129 if (!await db.Database.CanConnectAsync()) 129 130 { 131 + try 132 + { 133 + await db.Database.OpenConnectionAsync(); 134 + await db.Database.CloseConnectionAsync(); 135 + } 136 + catch (Exception e) 137 + { 138 + app.Logger.LogCritical("Failed to connect to database. Please make sure your configuration is correct."); 139 + app.Logger.LogError("Additional information: {e}", e); 140 + Environment.Exit(1); 141 + } 142 + 130 143 app.Logger.LogCritical("Failed to connect to database. Please make sure your configuration is correct."); 131 144 Environment.Exit(1); 132 145 }