mirror of
https://github.com/monero-project/monero.git
synced 2026-01-10 00:05:30 +09:00
simplewallet: report file writing failure for export_transfers command
This commit is contained in:
parent
41ad5238a0
commit
24ef33768c
@ -8768,6 +8768,10 @@ bool simple_wallet::export_transfers(const std::vector<std::string>& args_)
|
||||
}
|
||||
|
||||
std::ofstream file(filename);
|
||||
if(file.fail()) {
|
||||
fail_msg_writer() << boost::format(tr("Failed to open %s for writing")) % filename;
|
||||
return true;
|
||||
}
|
||||
|
||||
// header
|
||||
file <<
|
||||
@ -8837,7 +8841,11 @@ bool simple_wallet::export_transfers(const std::vector<std::string>& args_)
|
||||
}
|
||||
file.close();
|
||||
|
||||
success_msg_writer() << tr("CSV exported to ") << filename;
|
||||
if(file.fail()) {
|
||||
fail_msg_writer() << tr("Failed to export CSV to ") << filename;
|
||||
} else {
|
||||
success_msg_writer() << tr("CSV exported to ") << filename;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user