Skip to content

Commit 8e8a0fe

Browse files
author
Luke Gehorsam
authored
improve Steam logs on GetSteamProfile error (heroiclabs#1120)
1 parent 5681444 commit 8e8a0fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

server/core_authenticate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ func importSteamFriends(ctx context.Context, logger *zap.Logger, db *sql.DB, mes
831831

832832
steamProfiles, err := client.GetSteamFriends(ctx, publisherKey, steamId)
833833
if err != nil {
834-
logger.Info("Could not import Steam friends.", zap.Error(err))
834+
logger.Error("Could not import Steam friends.", zap.Error(err))
835835
return status.Error(codes.Unauthenticated, "Could not authenticate Steam profile.")
836836
}
837837

social/social.go

+3
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,15 @@ func (c *Client) GetSteamProfile(ctx context.Context, publisherKey string, appID
626626
var profileWrapper SteamProfileWrapper
627627
err := c.request(ctx, "steam profile", path, nil, &profileWrapper)
628628
if err != nil {
629+
c.logger.Debug("Error requesting Steam profile", zap.Error(err))
629630
return nil, err
630631
}
631632
if profileWrapper.Response.Error != nil {
633+
c.logger.Debug("Error returned from Steam after requesting Steam profile", zap.String("errorDescription", profileWrapper.Response.Error.ErrorDesc), zap.Int("errorCode", profileWrapper.Response.Error.ErrorCode))
632634
return nil, fmt.Errorf("%v, %v", profileWrapper.Response.Error.ErrorDesc, profileWrapper.Response.Error.ErrorCode)
633635
}
634636
if profileWrapper.Response.Params == nil {
637+
c.logger.Debug("No profile returned from Steam after requesting Steam profile")
635638
return nil, errors.New("no steam profile")
636639
}
637640
return profileWrapper.Response.Params, nil

0 commit comments

Comments
 (0)