mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Catch potential boost::process exceptions
Could happen if the perl executable isn't found and perhaps also if there's a stream exception.
This commit is contained in:
parent
d79306f7db
commit
32df095d4f
@ -50,6 +50,9 @@ GncQuotes::check (void)
|
|||||||
|
|
||||||
bp::ipstream out_stream;
|
bp::ipstream out_stream;
|
||||||
bp::ipstream err_stream;
|
bp::ipstream err_stream;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
bp::child process (perl_executable, "-w", fq_check, bp::std_out > out_stream, bp::std_err > err_stream);
|
bp::child process (perl_executable, "-w", fq_check, bp::std_out > out_stream, bp::std_err > err_stream);
|
||||||
|
|
||||||
std::string stream_line;
|
std::string stream_line;
|
||||||
@ -64,6 +67,12 @@ GncQuotes::check (void)
|
|||||||
|
|
||||||
process.wait();
|
process.wait();
|
||||||
m_cmd_result = process.exit_code();
|
m_cmd_result = process.exit_code();
|
||||||
|
}
|
||||||
|
catch (std::exception &e)
|
||||||
|
{
|
||||||
|
m_cmd_result = -1;
|
||||||
|
m_error_msg = e.what();
|
||||||
|
};
|
||||||
|
|
||||||
auto success = (m_cmd_result == 0);
|
auto success = (m_cmd_result == 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user