diff --git a/modules/user/user.go b/modules/user/user.go index fe3d037..1c3034f 100644 --- a/modules/user/user.go +++ b/modules/user/user.go @@ -53,6 +53,12 @@ func QueryUser(ctx context.Context, client *ent.Client, username string) (*ent.U // or more than 1 user returned. Only(ctx) if err != nil { + log.Warn("error querying user", "error", err, "username requested", username) + + if ent.IsNotFound(err) { + return nil, fmt.Errorf("user not found: %q", err) + } + return nil, fmt.Errorf("failed querying user: %w", err) }