Improve map serialization error logging & exception tolerance (#6188)

* Improve map serialization error logging

* Prevent remove children of erroring entities

* better logging

* Improve error tolerance

* Even more exception tolerance

* missing !

* Improve handling of category errors

Helps prevents weird bugs that arise due to deleting un-initialized entities

* release notes

* Typo fix

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
Leon Friedrich
2025-09-17 21:44:56 +02:00
committed by GitHub
co-authored by Pieter-Jan Briers
parent 912b6da20a
commit abd5149245
6 changed files with 179 additions and 58 deletions
@@ -86,3 +86,33 @@ public enum MissingEntityBehaviour
/// </summary>
AutoInclude,
}
public enum EntityExceptionBehaviour
{
/// <summary>
/// Re-throw the exception, interrupting the serialization.
/// </summary>
Rethrow,
/// <summary>
/// Continue serializing and simply skip/ignore this entity. May result in broken maps that log errors or simply
/// fail to load.
/// </summary>
IgnoreEntity,
/// <summary>
/// Continue serializing and simply skip/ignore this entity and all of its children.
/// May result in broken maps that log errors or simply fail to load.
/// </summary>
IgnoreEntityAndChildren,
// TODO SERIALIZATION
/*
/// <summary>
/// Continue the serialization while skipping over the component that caused the exception to be thrown. May result
/// in broken maps that log errors or simply fail to load.
/// </summary>
IgnoreComponent,
*/
}