I'm serializing data, and I have set DebugContext.ErrorHandlingPolicy = ErrorHandlingPolicy.ThrowOnWarningsAndErrors.
If my game tries to serialize a UnityEngine.Object subclass, I expect that this warning will result in a serialization error and serialization will halt, but that's not the case.
Is there a way to safely halt serialization of Unity objects?
(I've also tried throwing an Exception from a custom IExternalStringReferenceResolver, when encountering a Unity object that's not in the AssetDatabase, but this seems to result in corruption of data - I get "Sirenix.Serialization.SerializationAbortException : The following error was logged during serialization or deserialization: Reached end of array after 0 elements, when 1 elements were expected." errors when deserializing other unrelated data)
I'm serializing data, and I have set
DebugContext.ErrorHandlingPolicy = ErrorHandlingPolicy.ThrowOnWarningsAndErrors
.If my game tries to serialize a
UnityEngine.Object
subclass, I expect that this warning will result in a serialization error and serialization will halt, but that's not the case.Is there a way to safely halt serialization of Unity objects?
(I've also tried throwing an Exception from a custom IExternalStringReferenceResolver, when encountering a Unity object that's not in the AssetDatabase, but this seems to result in corruption of data - I get "Sirenix.Serialization.SerializationAbortException : The following error was logged during serialization or deserialization: Reached end of array after 0 elements, when 1 elements were expected." errors when deserializing other unrelated data)