IN-249 Improve handling of serialization errors

@dominicm