mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Catch boost::locale character-conversion exceptions.
Partial cause of the crash reported in Bug 797002.
This commit is contained in:
parent
95bee405cf
commit
3a105f0728
@ -2065,9 +2065,22 @@ CsvImpTransAssist::assist_summary_page_prepare ()
|
|||||||
gen.add_messages_domain(GETTEXT_PACKAGE);
|
gen.add_messages_domain(GETTEXT_PACKAGE);
|
||||||
|
|
||||||
auto text = std::string("<span size=\"medium\"><b>");
|
auto text = std::string("<span size=\"medium\"><b>");
|
||||||
|
try
|
||||||
|
{
|
||||||
/* Translators: {1} will be replaced with a filename */
|
/* Translators: {1} will be replaced with a filename */
|
||||||
text += (bl::format (bl::translate ("The transactions were imported from file '{1}'.")) % m_file_name).str(gen(""));
|
text += (bl::format (bl::translate ("The transactions were imported from file '{1}'.")) % m_file_name).str(gen(""));
|
||||||
text += "</b></span>";
|
text += "</b></span>";
|
||||||
|
}
|
||||||
|
catch (const bl::conv::conversion_error& err)
|
||||||
|
{
|
||||||
|
PERR("Transcoding error: %s", err.what());
|
||||||
|
text += "The transactions were imported from the file.</b></span>";
|
||||||
|
}
|
||||||
|
catch (const bl::conv::invalid_charset_error& err)
|
||||||
|
{
|
||||||
|
PERR("Invalid charset error: %s", err.what());
|
||||||
|
text += "The transactions were imported from the file.</b></span>";
|
||||||
|
}
|
||||||
gtk_label_set_markup (GTK_LABEL(summary_label), text.c_str());
|
gtk_label_set_markup (GTK_LABEL(summary_label), text.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user