mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-12 22:10:54 -04:00
Catch errors during filesystem rewrite
This commit is contained in:
parent
3cf157421d
commit
9ddd2a5d71
@ -840,29 +840,30 @@ int mkdwarfs(int argc, char** argv) {
|
|||||||
|
|
||||||
auto ti = LOG_TIMED_INFO;
|
auto ti = LOG_TIMED_INFO;
|
||||||
|
|
||||||
if (recompress) {
|
try {
|
||||||
filesystem_v2::rewrite(lgr, prog, std::make_shared<dwarfs::mmap>(path), fsw,
|
if (recompress) {
|
||||||
rw_opts);
|
filesystem_v2::rewrite(lgr, prog, std::make_shared<dwarfs::mmap>(path),
|
||||||
wg_compress.wait();
|
fsw, rw_opts);
|
||||||
} else {
|
wg_compress.wait();
|
||||||
options.inode.with_similarity =
|
} else {
|
||||||
force_similarity ||
|
options.inode.with_similarity =
|
||||||
options.file_order.mode == file_order_mode::SIMILARITY;
|
force_similarity ||
|
||||||
options.inode.with_nilsimsa =
|
options.file_order.mode == file_order_mode::SIMILARITY;
|
||||||
options.file_order.mode == file_order_mode::NILSIMSA;
|
options.inode.with_nilsimsa =
|
||||||
|
options.file_order.mode == file_order_mode::NILSIMSA;
|
||||||
|
|
||||||
scanner s(lgr, wg_scanner, cfg, entry_factory::create(),
|
scanner s(lgr, wg_scanner, cfg, entry_factory::create(),
|
||||||
std::make_shared<os_access_posix>(), std::move(script), options);
|
std::make_shared<os_access_posix>(), std::move(script),
|
||||||
|
options);
|
||||||
|
|
||||||
try {
|
|
||||||
s.scan(fsw, path, prog);
|
s.scan(fsw, path, prog);
|
||||||
} catch (runtime_error const& e) {
|
|
||||||
LOG_ERROR << e.what();
|
|
||||||
return 1;
|
|
||||||
} catch (system_error const& e) {
|
|
||||||
LOG_ERROR << e.what();
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
} catch (runtime_error const& e) {
|
||||||
|
LOG_ERROR << e.what();
|
||||||
|
return 1;
|
||||||
|
} catch (system_error const& e) {
|
||||||
|
LOG_ERROR << e.what();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ofs.close();
|
ofs.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user