2014-04-27 Carl Hetherington <cth@carlh.net>
+ * Slightly better handling of uncaught exceptions.
+
* Use our own directory picker on 14.04 (as well as 13.04 and 13.10) as
it appears that the same bug remains.
_paths.push_back (i->path ());
}
}
-
+
+ if (_paths.empty()) {
+ throw FileError (_("No valid image files were found in the folder."), p);
+ }
+
sort (_paths.begin(), _paths.end());
}
}
set_error (
e.what (),
- _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (carl@dcpomatic.com)")
+ _("It is not known what caused this error. Please report the problem to the DCP-o-matic author (carl@dcpomatic.com).")
);
set_progress (1);
set_error (
_("Unknown error"),
- _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (carl@dcpomatic.com)")
+ _("It is not known what caused this error. Please report the problem to the DCP-o-matic author (carl@dcpomatic.com).")
);
set_progress (1);
return true;
}
+ bool OnExceptionInMainLoop ()
+ {
+ error_dialog (0, _("An unknown exception occurred. Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."));
+ return false;
+ }
+
+ void OnUnhandledException ()
+ {
+ error_dialog (0, _("An unknown exception occurred. Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."));
+ }
+
void idle ()
{
ui_signaller->ui_idle ();
return;
}
- _film->examine_and_add_content (
- shared_ptr<ImageContent> (
- new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
- )
- );
+ shared_ptr<ImageContent> ic;
+
+ try {
+ ic.reset (new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ()))));
+ } catch (FileError& e) {
+ error_dialog (this, std_to_wx (e.what ()));
+ return;
+ }
+
+ _film->examine_and_add_content (ic);
}
void