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

Implement error reporting in python #82

Open
dsalantic opened this issue Jan 11, 2019 · 4 comments
Open

Implement error reporting in python #82

dsalantic opened this issue Jan 11, 2019 · 4 comments

Comments

@dsalantic
Copy link
Contributor

Currently parsing in python does not return error indication if something is wrong with input data or format definition, but it just ignores the error and returns what is available.
In c++ version, errors are printed to stderr.

Idea is to implement errors in python version.
Three possible ways:

  1. Return python exception after first error
    That way error will be easily detected, but correct data (if any) will not be returned.
  2. Return special field in return dictionary (e.g. list of erros) where all errors will be listed together with parsed data.
  3. Implement both ways, but activate them by flag in calling function.
    e.g. exception=True, errros=True
@gerardsimons
Copy link

I am having this issue too. I cannot have my Python code crash because of this, is there a way to handle the errors? Currently it kill the entire interpreter if the messages is too short for example

@dsalantic
Copy link
Contributor Author

It shouldn't crash. Can you pls. send message example that causes crash and I'll try to fix it.

@gerardsimons
Copy link

I will try to find an example for you

@zouyunkaicauc
Copy link

Hi,
Does 'something is wrong with input data or format definition' means that the input catxx package itself contains errors, or the module is currently unable to decode all kinds of data item in a catxx package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants