influxdata / flux

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.
https://influxdata.com
MIT License
760 stars 152 forks source link

refactor: improve "error package" returned when bad UTF-8 #5409

Closed wolffcm closed 1 year ago

wolffcm commented 1 year ago

This PR builds upon my last PR #5408 to use the expected form of AST to hold an error produced my invalid UTF8. The function flux_ast_get_error wants the error to be in the base node of the first file, rather than in the package itself.

This produces a nicer error message when clients pass in Flux code with invalid UTF-8.