There has been a report of file_size throwing an exception and
crashing DCP-o-matic, but I haven't been able to reproduce it yet
(possibly related to there being missing content files).
uintmax_t head_amount = amount;
uintmax_t tail_amount = amount;
uintmax_t head_amount = amount;
uintmax_t tail_amount = amount;
- uintmax_t size = boost::filesystem::file_size (_file);
+ boost::system::error_code ec;
+ uintmax_t size = boost::filesystem::file_size (_file, ec);
+ if (size == static_cast<uintmax_t>(-1)) {
+ return "";
+ }
if (size < (head_amount + tail_amount)) {
head_amount = size;
if (size < (head_amount + tail_amount)) {
head_amount = size;
chain->set_key (dcp::file_to_string (p));
_set (chain);
update_private_key ();
chain->set_key (dcp::file_to_string (p));
_set (chain);
update_private_key ();
- } catch (dcp::MiscError& e) {
+ } catch (std::exception& e) {
error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what()));
}
}
error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what()));
}
}