You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The try/finally block in the SerializationGraphNavigator making sure the context visitingStack is working correctly hides all Exceptions thrown in handlers when the context has started visiting a (nested) object but has not stopped visiting is.
This is the case in many situations where a handler (like the ArrayCollectionHandler) is used to serialize a more complex object (or object with objects).
The try/finally block in the
SerializationGraphNavigator
making sure the context visitingStack is working correctly hides all Exceptions thrown in handlers when the context has started visiting a (nested) object but has not stopped visiting is.This is the case in many situations where a handler (like the
ArrayCollectionHandler
) is used to serialize a more complex object (or object with objects).Code hiding the exception is this one:
https://github.com/schmittjoh/serializer/blob/3.5.0/src/GraphNavigator/SerializationGraphNavigator.php#L196-L200
This is because
finally
is executed before the Exception is thrown and thestopVisiting()
causes an other Exception to be thrown, hiding the first Exception.Running
stopVisiting()
first is sometimes necessaryThe commit that introduced this change makes it clear it is created for a specific situation where serializing NULL throws an exception: ffc0fee
The fact that this
NotAcceptableException
is needed is also mentioned in the UPGRADING guide: https://github.com/schmittjoh/serializer/blame/3.5.0/UPGRADING.md#L56-L57Steps required to reproduce the problem
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: