$darkmode
Elektra 0.11.0
|
In the previous error concept it was very useful to generate macros as we often added new errors. The code generation itself, however, was not ideal for cross compilation.
std::cout << ...
code from C++ but not much more.std::cout << ...
in the C++ code, but not much else would change. The other option is to use the default mustache executable, which is a Ruby script and therefore requires Ruby to be installed. Also kdb gen
cannot be reused, since that would require compiling kdb first, which needs kdberrors.h.Write down the few macros manually, and also manually write down exceptions for the language bindings (and also the mappings from Elektra's internal errors to nice errors specific for the languages).
Since error codes and crucial parts Elektra's core implementation will not often change this is the best approach with minimal effort.
The existing code will be refactored so that error macros directly call macros.
When adding a new error code, language bindings have to be adapted accordingly such as the Rust or Java Binding.