@@ -313,19 +313,30 @@ namespace geode
313313 template < typename Archive >
314314 void serialize ( Archive &archive )
315315 {
316- archive.ext ( *this ,
317- Growable< Archive, Impl >{
318- { []( Archive &local_archive, Impl &impl ) {
319- local_archive.value4b ( impl.nb_elements_ );
320- local_archive.ext ( impl.attributes_ ,
321- bitsery::ext::StdMap{ impl.attributes_ .max_size () },
322- []( Archive &local_archive2, std::string &name,
323- std::shared_ptr< AttributeBase > &attribute ) {
324- local_archive2.text1b ( name, name.max_size () );
316+ archive.ext (
317+ *this , Growable< Archive, Impl >{ { []( Archive &local_archive,
318+ Impl &impl ) {
319+ local_archive.value4b ( impl.nb_elements_ );
320+ local_archive.ext ( impl.attributes_ ,
321+ bitsery::ext::StdMap{ impl.attributes_ .max_size () },
322+ []( Archive &local_archive2, std::string &name,
323+ std::shared_ptr< AttributeBase > &attribute ) {
324+ local_archive2.text1b ( name, name.max_size () );
325+ try
326+ {
325327 local_archive2.ext (
326328 attribute, bitsery::ext::StdSmartPtr{} );
327- } );
328- } } } );
329+ }
330+ catch ( ... )
331+ {
332+ throw OpenGeodeException{
333+ " [AttributeManager::serialize] Cannot "
334+ " serialize attribute " ,
335+ name, " holding type " , attribute->type ()
336+ };
337+ }
338+ } );
339+ } } } );
329340 }
330341
331342 private:
0 commit comments