Skip to content
Snippets Groups Projects

armem/dev => master

Merged Fabian Reister requested to merge armem/dev into master
2 files
+ 29
46
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -84,60 +84,43 @@ namespace armarx::armem::server::obj
instance::SegmentAdapter::init();
// class segment
try
const auto initSegmentWithCatch = [&](const std::string & segmentName, const auto&& fn)
{
classSegment.init();
}
catch (const LocalException& e)
{
ARMARX_ERROR << "Failed to init class segment. Reason: \n" << e.what();
}
catch (const std::exception& e)
{
ARMARX_ERROR << "Failed to init class segment. Reason: \n" << e.what();
}
catch (...)
try
{
fn();
}
catch (const LocalException& e)
{
ARMARX_ERROR << "Failed to init " << segmentName << " segment. Reason: \n" << e.what();
}
catch (const std::exception& e)
{
ARMARX_ERROR << "Failed to init " << segmentName << " segment. Reason: \n" << e.what();
}
catch (...)
{
ARMARX_ERROR << "Failed to init " << segmentName << " segment for unknown reason.";
}
};
initSegmentWithCatch("class", [&]()
{
ARMARX_ERROR << "Failed to init class segment for unknown reason.";
}
classSegment.init();
});
// articulated object class segment
try
initSegmentWithCatch("articulated object class", [&]()
{
articulatedObjectClassSegment.init();
}
catch (const LocalException& e)
{
ARMARX_ERROR << "Failed to init class segment. Reason: \n" << e.what();
}
catch (const std::exception& e)
{
ARMARX_ERROR << "Failed to init class segment. Reason: \n" << e.what();
}
catch (...)
{
ARMARX_ERROR << "Failed to init class segment for unknown reason.";
}
});
// articulated object instance segment
try
initSegmentWithCatch("articulated object instance", [&]()
{
articulatedObjectInstanceSegment.setArticulatedObjectClassSegment(articulatedObjectClassSegment);
articulatedObjectInstanceSegment.init();
}
catch (const LocalException& e)
{
ARMARX_ERROR << "Failed to init class segment. Reason: \n" << e.what();
}
catch (const std::exception& e)
{
ARMARX_ERROR << "Failed to init class segment. Reason: \n" << e.what();
}
catch (...)
{
ARMARX_ERROR << "Failed to init class segment for unknown reason.";
}
});
}
void ObjectMemory::onConnectComponent()
Loading