chore: better error message
This commit is contained in:
parent
ea3f4e4c0d
commit
35bf742494
1 changed files with 5 additions and 1 deletions
|
|
@ -3,6 +3,8 @@ package vehicle
|
|||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
// ensureVehicle extracts VIN from list of VINs returned from `list` function
|
||||
|
|
@ -38,7 +40,9 @@ func ensureVehicleEx[Vehicle any](
|
|||
return vehicles[0], nil
|
||||
}
|
||||
|
||||
err = fmt.Errorf("cannot find vehicle, got: %v", vehicles)
|
||||
err = fmt.Errorf("cannot find vehicle, got: %v", lo.Map(vehicles, func(v Vehicle, _ int) string {
|
||||
return extract(v)
|
||||
}))
|
||||
}
|
||||
|
||||
return *new(Vehicle), err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue