Skip to content

Commit

Permalink
send on transformation error
Browse files Browse the repository at this point in the history
  • Loading branch information
colmsnowplow committed May 30, 2024
1 parent 43becdd commit d9c7f4e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,18 @@ func NewTransformation(tranformFunctions ...TransformationFunction) Transformati

}
if failure != nil {
failure.Meta["transformation_error"] = failure.GetError().Error()
failureList = append(failureList, failure)

failure.Meta["transformation_error"] = failure.GetError().Error()
metaJSON, err := json.Marshal(filtered.Meta)
if err != nil {
fmt.Println("ERROR MARSHALING FILTER META: " + err.Error())
}
resp, err := http.Post(os.Getenv("META_HTTP_ADDRESS"), "application/json", bytes.NewBuffer(metaJSON))
if err != nil {
fmt.Println("ERROR SENDING FILTER META REQUEST: " + err.Error())
}
resp.Body.Close()
}
}
return models.NewTransformationResult(successList, filteredList, failureList)
Expand Down

0 comments on commit d9c7f4e

Please sign in to comment.