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

Exception hardening #3144

Merged
merged 8 commits into from
Jun 17, 2024
Merged

Conversation

ohlidalp
Copy link
Member

This should put a stop to the game panicking on any unhandled exceptions, which are usually trivially recoverable, like this dialog which was caused by a .mesh file missing from a terrain:
obrazek

All exceptions which happen during processing message queue are now automatically logged to RoR.log and also forwarded to AngelScript as game event - a trick already widely used in OGRE bindings, see SE_GENERIC_EXCEPTION_CAUGHT.

@ohlidalp ohlidalp force-pushed the exception_hardening branch 2 times, most recently from ef0e375 to 35f93cb Compare May 28, 2024 22:44
Removed helper `HandleException()` - all handling is now done via `forwardExceptionAsScriptEvent()`.
Codechanges:
* Application: added `HandleGenericException()` helper + convenience wrapper for msg queue.
* main: wrapped all message processing cases in `try{}catch()` - a lot of boilerplate, but likely worth it.
* Cache system: removed custom exception handling - just propagate exceptions up and handle in bulk.
If flexbody cannot be loaded for any reason, always create a placeholder - this was previously done only if removed via Tuning system.
    /*NEW*/enum class PlaceholderType
    {
        NOT_A_PLACEHOLDER,
        TUNING_REMOVED_PLACEHOLDER,
        FAULTY_FORSET_PLACEHOLDER,
        FAULTY_MESH_PLACEHOLDER,
    };

The FlexbodyDebug UI was extended to recognize placeholders and not crash but display the placeholder type instead.
This crash happened to me repeatedly when I removed an actor which was constantly exploding and resetting - apparently the MODIFY_ACTOR was queued when DELETE_ACTOR was already in queue.
@ohlidalp
Copy link
Member Author

Merging in good faith without peer approval - I've been developing other branches on top of this for about a week, and didn't observe any issues, in fact I added a few more error tolerance commits.

@ohlidalp ohlidalp merged commit cfeba57 into RigsOfRods:master Jun 17, 2024
2 checks passed
@ohlidalp ohlidalp deleted the exception_hardening branch June 17, 2024 17:19
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.

None yet

1 participant