refactor(mkdwarfs): catch exceptions when building categorizers

This commit is contained in:
Marcus Holland-Moritz 2025-08-29 14:59:18 +02:00
parent 1d426f3331
commit 2c9ea48bd9

View File

@ -1240,9 +1240,14 @@ int mkdwarfs_main(int argc, sys_char** argv, iolayer const& iol) {
options.inode.categorizer_mgr = options.inode.categorizer_mgr =
std::make_shared<writer::categorizer_manager>(lgr, path); std::make_shared<writer::categorizer_manager>(lgr, path);
for (auto const& name : categorizers) { try {
options.inode.categorizer_mgr->add( for (auto const& name : categorizers) {
catreg.create(lgr, name, vm, iol.file)); options.inode.categorizer_mgr->add(
catreg.create(lgr, name, vm, iol.file));
}
} catch (std::exception const& e) {
LOG_ERROR << "could not create categorizer: " << e.what();
return 1;
} }
} }