Handle missing objects in cta-objectstore-dump-object tool graciously
At the moment, if we try to dump an object that does not exist with cta-objectstore-dump-object
, it throws an unnecessary exception.
Instead, we should print a clear and user-friendly message.
[root@ctaproductionfrontend11 ~]# cta-objectstore-dump-object RepackIndex-cta-objectstore-create-missing-repack-index-ctaproductionfrontend11.cern.ch-2800352-20250411-12:46:
Object store path: rados://cta-production@tapecta:cta-production
Object name: RepackIndex-cta-objectstore-create-missing-repack-index-ctaproductionfrontend11.cern.ch-2800352-20250411-12:46:
Failed to dump object:
In BackendRados::read(): considering empty object (name=RepackIndex-cta-objectstore-create-missing-repack-index-ctaproductionfrontend11.cern.ch-2800352-20250411-12:46:) as non-existing.
/usr/lib64/libctacommon.so.0(cta::exception::Backtrace::Backtrace(bool)+0x6b) [0x7efeb05a9c49]
/usr/lib64/libctacommon.so.0(cta::exception::Exception::Exception(std::basic_string_view<char, std::char_traits<char> >, bool)+0x91) [0x7efeb05aad11]
/usr/lib64/libctaobjectstore.so.0(cta::exception::NoSuchObject::NoSuchObject(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x49) [0x7efeb0ddf62d]
/usr/lib64/libctaobjectstore.so.0(cta::objectstore::BackendRados::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x18f) [0x7efeb0de4ebd]
cta-objectstore-dump-object(cta::objectstore::ObjectOps<cta::objectstore::serializers::GenericObject, (cta::objectstore::serializers::ObjectType)1000>::getHeaderFromObjectStore()+0x54) [0x41ba5c]
cta-objectstore-dump-object(cta::objectstore::ObjectOps<cta::objectstore::serializers::GenericObject, (cta::objectstore::serializers::ObjectType)1000>::fetchBottomHalf()+0x2f) [0x41b5ef]
cta-objectstore-dump-object() [0x41aab4]
cta-objectstore-dump-object() [0x414bf6]
/usr/lib64/libc.so.6(+0x295d0) [0x7efeaf0295d0]
/usr/lib64/libc.so.6(__libc_start_main+0x80) [0x7efeaf029680]
cta-objectstore-dump-object() [0x4146c5]