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

Return errors to Lua rather than dieing outright #24

Open
alerque opened this issue Nov 18, 2022 · 0 comments
Open

Return errors to Lua rather than dieing outright #24

alerque opened this issue Nov 18, 2022 · 0 comments

Comments

@alerque
Copy link
Member

alerque commented Nov 18, 2022

See for example this comment: sile-typesetter/sile#872 (comment)

The drawimage() function and several others have the potential to run the ERROR() function which spits out a cryptic message and then dies hard. This is not friendly at all to applications which can't catch and handle such a problem — not even to error themselves with a friendlier message.

The library should be throwing an error that can be caught with pcall() in Lua, not just aborting. This probably means the exit(1) needs to be replaced in error.c with something more friendly to the lua module interface.

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

No branches or pull requests

1 participant