Skip to content

Commit

Permalink
[SM-395] add year to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Rodriguez authored and Eduardo Rodriguez committed Jan 3, 2024
1 parent a6c6388 commit dad6d2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/rpc/user_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"errors"
"fmt"
"math/big"

"strings"
Expand Down Expand Up @@ -294,10 +295,11 @@ func (s *userDeviceRPCServer) RegisterUserDeviceFromVIN(ctx context.Context, req
if resp.Year < 2008 {
s.logger.Warn().
Str("vin", vin).
Str("year", fmt.Sprint(resp.Year)).
Str("user_id", req.UserDeviceId).
Msg("VIN is too old")

return nil, status.Errorf(codes.InvalidArgument, "VIN %s is too old", vin)
return nil, status.Errorf(codes.InvalidArgument, "VIN %s from year %v is too old", vin, resp.Year)
}

if err != nil {
Expand Down

0 comments on commit dad6d2f

Please sign in to comment.