Skip to content

Commit

Permalink
Fix in warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Dec 1, 2023
1 parent c70e3f5 commit d4d48ae
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions actions/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,18 @@ func ValidateUpload(ctx context.Context, cfg config.Config, src io.Reader, feedU
ErrorType: eg.ErrorType,
ErrorCode: eg.ErrorCode,
}
if v, ok := err.(hasGeometries); ok {
for _, g := range v.Geometries() {
g := g
err2.Geometries = append(err2.Geometries, &g)
}
}

if v, ok := err.(hasContext); ok {
c := v.Context()
err2.EntityID = c.EntityID
err2.ErrorCode = c.Code
err2.Field = c.Field
}
if v, ok := err.(hasGeometries); ok {
for _, g := range v.Geometries() {
g := g
err2.Geometries = append(err2.Geometries, &g)
}
}
eg2.Errors = append(eg2.Errors, &err2)
}
result.Errors = append(result.Errors, eg2)
Expand Down Expand Up @@ -171,6 +170,12 @@ func ValidateUpload(ctx context.Context, cfg config.Config, src io.Reader, feedU
err2.EntityID = c.EntityID
err2.Field = c.Field
}
if v, ok := err.(hasGeometries); ok {
for _, g := range v.Geometries() {
g := g
err2.Geometries = append(err2.Geometries, &g)
}
}
eg2.Errors = append(eg2.Errors, &err2)
}
result.Warnings = append(result.Warnings, eg2)
Expand Down

0 comments on commit d4d48ae

Please sign in to comment.