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

Raise a Python error if a JS error was encountered #47

Open
binste opened this issue Apr 4, 2023 · 3 comments
Open

Raise a Python error if a JS error was encountered #47

binste opened this issue Apr 4, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@binste
Copy link

binste commented Apr 4, 2023

The JavaScript error reported in #46 does not raise a corresponding Python error. Instead, vl-convert still returns an svg string but the svg itself is wrong due to the error which happened on the JS level:

image

Would it be possible to raise all JS errors? Especially when generating a large number of charts, it would be important to know if everything worked as expected.

@jonmmease
Copy link
Collaborator

I'll take a closer look at what's going on. I believe some JS errors do result in Python errors (like when the input spec is invalid), but I think the issue in #46 is that the error occurs in a custom callback function that's registered with Vega, and Vega keeps on going when the callback raises an exception.

@binste
Copy link
Author

binste commented Apr 4, 2023

Thank you, that's much appreciated! I'm not familiar enough with rust and JS to contribute to this issue or #46 but let me know if there is something on the Python level that can be done.

@jonmmease
Copy link
Collaborator

I played around with this a bit, but I can't figure out yet why exceptions raised in our text width calculation function don't propagate up to becoming exceptions in the SVG export function (but are instead printed as error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants