mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Improve reporting when parse_quote throws an exception.
Add more detail to the error message and pass the right value to the gnc_error_dialog so that the error is actually displayed to the user.
This commit is contained in:
parent
0909fd9b0f
commit
a5404f6607
@ -569,7 +569,7 @@ gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
gnc_unset_busy_cursor(nullptr);
|
||||
PERR("Price retrieval failed: %s", err.what());
|
||||
gnc_error_dialog(GTK_WINDOW(pdb_dialog), _("Price retrieval failed: %s"), err.what());
|
||||
gnc_error_dialog(GTK_WINDOW(pdb_dialog->window), _("Price retrieval failed: %s"), err.what());
|
||||
}
|
||||
|
||||
/* Without this, the summary bar on the accounts tab
|
||||
|
@ -728,7 +728,7 @@ GncQuotesImpl::parse_quotes (const std::string& quote_str)
|
||||
{
|
||||
bpt::ptree pt;
|
||||
std::istringstream ss {quote_str};
|
||||
const char* what = nullptr;
|
||||
std::string what;
|
||||
|
||||
try
|
||||
{
|
||||
@ -747,15 +747,26 @@ GncQuotesImpl::parse_quotes (const std::string& quote_str)
|
||||
}
|
||||
catch (...) {
|
||||
std::string error_msg{_("Failed to parse result returned by Finance::Quote.")};
|
||||
error_msg += "\n";
|
||||
//Translators: This labels the return value of a query to Finance::Quote written in an error.
|
||||
error_msg += _("Result:");
|
||||
error_msg += "\n";
|
||||
error_msg += quote_str;
|
||||
throw(GncQuoteException(error_msg));
|
||||
}
|
||||
if (what)
|
||||
if (!what.empty())
|
||||
{
|
||||
std::string error_msg{_("Failed to parse result returned by Finance::Quote.")};
|
||||
error_msg += "\n";
|
||||
//Translators: This is the error message reported by the Online Quotes processing code.
|
||||
error_msg += _("Error message:");
|
||||
error_msg += "\n";
|
||||
error_msg += what;
|
||||
error_msg += "\n";
|
||||
//Translators: This labels the return value of a query to Finance::Quote written in an error.
|
||||
error_msg += _("Result:");
|
||||
error_msg += "\n";
|
||||
error_msg += quote_str;
|
||||
throw(GncQuoteException(error_msg));
|
||||
}
|
||||
return pt;
|
||||
|
Loading…
Reference in New Issue
Block a user