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

Result of checkErrorAndThrow is ignored #83

Open
Flamefire opened this issue Dec 23, 2017 · 0 comments
Open

Result of checkErrorAndThrow is ignored #83

Flamefire opened this issue Dec 23, 2017 · 0 comments

Comments

@Flamefire
Copy link
Contributor

When calling a lua function checkErrorAndThrow is called which reports an error. However the return value (false on error) is ignored. So calling e.g. a lua function returning a bool will return true even in the error case unless the error handler throws an exception.
Not sure, if this is the expected behaviour as e.g. an invalid lua state returns a default constructed result.

Also there is no way to check for an error. If something like this was possible would be great: if(!lua["boolFunc"].call<bool>() || !lua) return false;

But unless the error handler throws there is no way do distinguish between a normal return or a error state.

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