Refactor compiler error codes #1189
Labels
meta: good first issue
Anything that is good for new contributors
type: tech debt
A code change that does not add user value
vrl: compiler
Changes to the compiler
The Problem
Currently we assign arbitrary error codes in different modules e.g.
These codes are scattered across different files and there's nothing preventing us from reusing them.
Solution
We should aggregate these under a single enum in
src/compiler/errors
.Without giving this too much thought (might revisit later), we can have static arrays of codes:
and then use them like so:
Docs
If we find duplicates and have to re-assign codes, we will also need to update:
https://vector.dev/docs/reference/vrl/errors/#compile-time-errors
Changing codes assigned to errors IMO isn't a breaking change.
References
Ideally these should be generated from code, see #280.
The text was updated successfully, but these errors were encountered: