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
When would you throw the error? The event not having a parent event set is only really an error during serialization, but we don't have enough context in the serializer there to determine easily if the session property is set.
It would make sense to do it during serialisation as that is the exact point it should all be valid. Otherwise you'd be wrongly throwing exceptions while building up the model.
I suppose you'd need some pre-serialisation validation method/rule on the model that the serialiser could be aware of to call. But I guess we're into quite a bit of complexity for a little bit of convenience here, and maybe catching it in the validator is fine :)
Might be worth the library throwing a RuntimeException here so that the error can be picked up in development before using the validator.
The text was updated successfully, but these errors were encountered: