Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have clear responsibility, who sets errors #2726

Open
markus2330 opened this issue May 26, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@markus2330
Copy link
Contributor

commented May 26, 2019

For plugins we have a well-defined interface (plugins must set an error if they return -1) but for functions from libs this responsibility currently is not so clear:

  • elektraModulesLoad sets warnings but no errors
  • elektraPluginOpen sets warnings but no errors
  • elektraInvokeOpen might set warnings but no errors, even though it has documented that "errorKey a key where error messages will be stored"
  • elektraGetOpts sets errors

as we now can transform every error to a warning easily, we could let the function set an error (normal case) and if the caller has some workaround, the caller can transform the error to a warning. This seems to be more robust than trusting that the callee sets the errors (which often does not happen, e.g. elektraSpecloadOpen if elektraInvokeOpen failed).

The docu of these functions and doc/CODING.md also needs to be updated to reflect the new error concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.