Skip to content

BaseFormatter's "T inherits from UnityEngine.Object" warning doesn't halt serialization properly #63

Description

@tconkling

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions