Added proper debug logging to safeconn methods

This commit is contained in:
2025-02-18 10:02:42 +11:00
parent b4b57c14cb
commit c2de8d254a
9 changed files with 83 additions and 45 deletions

View File

@@ -115,8 +115,8 @@ func Authentication(
// Start the transaction
tx, err := conn.Begin(ctx)
if err != nil {
// Failed to start transaction, warn the user they cant login right now
logger.Warn().Err(err).Msg("Request failed to start a transaction")
// Failed to start transaction, send 503 code to client
logger.Warn().Err(err).Msg("Skipping Auth - unable to start a transaction")
w.WriteHeader(http.StatusServiceUnavailable)
next.ServeHTTP(w, r)
return