Skip to content

Fix partial loads when a script errors on load. #21

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

Merged
merged 3 commits into from
May 21, 2025
Merged

Conversation

Saturn745
Copy link
Member

  • Fix partial loads when a script errors on load.
  • Fix /lualink reload|unload erroring on scripts that aren't already loaded.

Fix /lualink reload|unload erroring on scripts that aren't already loaded.
@Saturn745 Saturn745 requested a review from Copilot May 21, 2025 18:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request addresses issues when a script errors during load by cleaning up partial registrations and improves error handling for script unload/reload commands.

  • Wraps the main file load in a pcall and cleans up state on failure.
  • Adds checks for whether a script is loaded before attempting unload or reload in LuaLink.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/main/resources/lua/scriptmanager.lua Wraps loadMainFile in pcall and cleans up partial state on error.
src/main/resources/lua/lualink.lua Adds script loaded checks and improves error messages during unload/reload.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Saturn745
Copy link
Member Author

Interesting...

@Saturn745 Saturn745 merged commit d16f365 into master May 21, 2025
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

Successfully merging this pull request may close these issues.

1 participant