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

Clean up/improve some scriptapi error handling code #11594

Merged
merged 4 commits into from
Sep 10, 2021

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Sep 5, 2021

Mostly cleanup, one specific improvement for s_item.cpp: If the return type was wrong the error message did not contain the callback that was called (leaving server admins guessing).

To do

This PR is Ready for Review.

runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC);
} catch (LuaError &e) {
getClient()->setFatalError(e);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client needs this because it does not have a central place to catch LuaErrors

src/server.h Outdated Show resolved Hide resolved
src/script/cpp_api/s_env.cpp Show resolved Hide resolved
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works

@sfan5 sfan5 merged commit 766e885 into minetest:master Sep 10, 2021
@sfan5 sfan5 deleted the cppapicleanup branch September 10, 2021 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants