more informative error message for bad serialization