From 0cf2c02af47dfb74432c3843aab5a67ff6af831d Mon Sep 17 00:00:00 2001 From: Hiveer Date: Wed, 25 Sep 2024 18:15:45 +0800 Subject: [PATCH] Print create user error backtrace --- internal/handlers/render/session.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/handlers/render/session.go b/internal/handlers/render/session.go index 96df6ff70..fd17c3047 100644 --- a/internal/handlers/render/session.go +++ b/internal/handlers/render/session.go @@ -93,7 +93,8 @@ func (i *SessionHandlerImpl) Create(ctx *gin.Context) { err = i.userModel.Create(ctx, user) if err != nil { - slog.Error("Login Error", "error", "create user failed", slog.Any("error", err), "uuid", userResp.UUID) + stackTrace := string(debug.Stack()) + slog.Error("Login Error", "error", "create user failed", slog.Any("error", err), "uuid", userResp.UUID, "stack", stackTrace) ctx.Redirect(http.StatusFound, "/errors/login-failed") return }