mirror of
https://github.com/monero-project/monero.git
synced 2025-12-10 07:22:34 +01:00
Merge pull request #10244
24ef337 simplewallet: report file writing failure for export_transfers command (WHR)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user