Three small inconsistencies surfaced during scoping of the
"every error becomes 404" fix (PR #83); none of them were that bug, so
they were flagged out-of-scope in the spec. Unblocked now that #83 has
merged. Bundle into a single chore PR.
-
Roster handlers use plain errors.New instead of status.Errorf(codes.InvalidArgument, ...).
GetRoster / GetLiteRoster / GetS1UniformsRoster all do
return nil, errors.New("cannot request null roster type") on
RosterType_ROSTER_TYPE_UNSPECIFIED. grpc-gateway wraps that as
codes.Unknown → HTTP 500, when it should be
codes.InvalidArgument → HTTP 400 (consumer sent a bad enum). Three
one-line swaps.
-
Empty Keycloak / Discord ID warn-but-continue.
GetUserViaKeycloakId and GetUserViaDiscordId log a warning then
fall through to the lookup with the empty string. Should early-return
status.Errorf(codes.InvalidArgument, ...) like GetGamertagProfile
already does. Two roughly-symmetric blocks.
-
processProfiles-error wrap inconsistency.
FindProfileByKeycloakID and FindProfileByDiscordID return
fmt.Errorf("error generating profile") — no %w, no underlying err
in the message. The other three single-row finders (FindProfilesById,
FindProfilesByUsername, FindProfileByGamertag) all use
fmt.Errorf("error generating profile: %w", err). The S1-uniforms
inline loop (FindS1UniformsRosterByType) has the same bare-string
outlier. Make all of them match. No observable consumer change today
(handler maps all to codes.Internal), but the inconsistency will
break a future errors.Is check the moment one is added.
Bundled because they all touch the same files and split cleanly per
commit.
Three small inconsistencies surfaced during scoping of the
"every error becomes 404" fix (PR #83); none of them were that bug, so
they were flagged out-of-scope in the spec. Unblocked now that #83 has
merged. Bundle into a single chore PR.
Roster handlers use plain
errors.Newinstead ofstatus.Errorf(codes.InvalidArgument, ...).GetRoster/GetLiteRoster/GetS1UniformsRosterall doreturn nil, errors.New("cannot request null roster type")onRosterType_ROSTER_TYPE_UNSPECIFIED. grpc-gateway wraps that ascodes.Unknown→ HTTP 500, when it should becodes.InvalidArgument→ HTTP 400 (consumer sent a bad enum). Threeone-line swaps.
Empty Keycloak / Discord ID warn-but-continue.
GetUserViaKeycloakIdandGetUserViaDiscordIdlog a warning thenfall through to the lookup with the empty string. Should early-return
status.Errorf(codes.InvalidArgument, ...)likeGetGamertagProfilealready does. Two roughly-symmetric blocks.
processProfiles-error wrap inconsistency.FindProfileByKeycloakIDandFindProfileByDiscordIDreturnfmt.Errorf("error generating profile")— no%w, no underlying errin the message. The other three single-row finders (
FindProfilesById,FindProfilesByUsername,FindProfileByGamertag) all usefmt.Errorf("error generating profile: %w", err). The S1-uniformsinline loop (
FindS1UniformsRosterByType) has the same bare-stringoutlier. Make all of them match. No observable consumer change today
(handler maps all to
codes.Internal), but the inconsistency willbreak a future
errors.Ischeck the moment one is added.Bundled because they all touch the same files and split cleanly per
commit.