[gnucash-commands.cpp] display report errors to stderr

This commit is contained in:
Christopher Lam 2021-01-02 21:45:45 +08:00
parent 955043b8c9
commit 15ecf114c6

View File

@ -260,9 +260,9 @@ return a document object with export-string or export-error.") << std::endl;
if (scm_is_false (id)) if (scm_is_false (id))
scm_cleanup_and_exit_with_failure (nullptr); scm_cleanup_and_exit_with_failure (nullptr);
char* html; char *html, *errmsg;
gnc_run_report (scm_to_int(id), &html);
if (html && *html) if (gnc_run_report_with_error_handling (scm_to_int(id), &html, &errmsg))
{ {
if (!args->output_file.empty()) if (!args->output_file.empty())
{ {
@ -273,6 +273,10 @@ return a document object with export-string or export-error.") << std::endl;
std::cout << html << std::endl; std::cout << html << std::endl;
} }
} }
else
{
std::cerr << errmsg << std::endl;
}
} }
qof_session_destroy (session); qof_session_destroy (session);