Skip to content

Commit 9e6da7e

Browse files
committed
control for not found vin
1 parent bb58249 commit 9e6da7e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/device-definitions-api/add_vins_csv.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ func (p *addVINsCSVCmd) Execute(ctx context.Context, _ *flag.FlagSet, _ ...inter
172172
errorCount++
173173
continue
174174
}
175+
if deviceDefinition == nil {
176+
p.logger.Error().Str("vin", vin).Str("definitionID", definitionID).Msg("Device definition not found")
177+
fmt.Printf("Error: Device definition '%s' not found for VIN '%s'\n", definitionID, vin)
178+
errorCount++
179+
continue
180+
}
175181

176182
vinNumber := models.VinNumber{
177183
Vin: vin,

0 commit comments

Comments
 (0)