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

provide API to get/set errors in cpp/python #3129

Open
markus2330 opened this issue Oct 29, 2019 · 2 comments
Assignees

Comments

@markus2330
Copy link
Contributor

@markus2330 markus2330 commented Oct 29, 2019

We now have a much simplified error system. It would be nice if these errors/warnings are better integrated in python/lua, e.g. by providing exception classes that can be thrown from plugins and/or can be caught from failing kdbGet/kdbSet.

See also doc/tutorials/language-bindings.md

Maybe make first a proposal how to do it before implementing something.

@manuelm

This comment has been minimized.

Copy link
Contributor

@manuelm manuelm commented Oct 31, 2019

If python plugins should be able to throw errors the cpp bindings need exception classes. So someone (def. not me) needs to generate these C++ exception classes during build time. And we definitely need to intergrate the generated helpers which fills the exception payload (the error key) into the exception classes.

After this is done the python plugin can be extended to catch the base exception and extract the errorkey payload.

Regarding kdb open/get/set/close: Should be implemented in the cpp bindings. After step 1. python will automatically pick it up.

Lua doesn't support any kind of exceptions at all.

@manuelm manuelm changed the title provide API to get/set errors in python/lua provide API to get/set errors in cpp/python Oct 31, 2019
@manuelm manuelm removed their assignment Oct 31, 2019
@markus2330

This comment has been minimized.

Copy link
Contributor Author

@markus2330 markus2330 commented Oct 31, 2019

@Piankero can you create the C++ exception classes for our errors (as decided manually) and an exception creator (which creates the correct exceptions based on error type)?

If you need any help, please open a new issue. It should be quite straight forward (only minimal classes extending from KDBError). Btw. I am very open to drop the idea of USER_DEFINED_EXCEPTIONS, they are too complicated once we have a hierarchy of exceptions.

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