using std::cerr;
using boost::shared_ptr;
using boost::optional;
-using boost::algorithm::is_any_of;
-using boost::algorithm::split;
+using boost::algorithm::trim;
using dcp::raw_convert;
Config* Config::_instance = 0;
for (vector<boost::filesystem::path>::const_iterator i = _history.begin(); i != _history.end(); ++i) {
root->add_child("History")->add_child_text (i->string ());
}
-
- doc.write_to_file_formatted (file().string ());
+
+ try {
+ doc.write_to_file_formatted (file().string ());
+ } catch (xmlpp::exception& e) {
+ string s = e.what ();
+ trim (s);
+ throw FileError (s, file ());
+ }
}
boost::filesystem::path
{
try {
throw;
+ } catch (FileError& e) {
+ error_dialog (0, wxString::Format (_("An exception occurred: %s in %s.\n\n" + REPORT_PROBLEM), e.what(), e.file().string().c_str ()));
} catch (exception& e) {
- error_dialog (0, wxString::Format (_("An exception occurred (%s)."), e.what ()) + " " + REPORT_PROBLEM); } catch (...) {
+ error_dialog (0, wxString::Format (_("An exception occurred: %s.\n\n"), e.what ()) + " " + REPORT_PROBLEM);
+ } catch (...) {
error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM);
}