From 8218bf98ca1ec9399a968e57f416e110e14d5d9f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 12 Apr 2013 20:29:27 +0100 Subject: Catch exceptions when checking disk space. --- src/lib/job.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/job.cc b/src/lib/job.cc index ff0332d6d..f830975af 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -68,11 +68,15 @@ Job::run_wrapper () set_state (FINISHED_ERROR); string m = String::compose (_("An error occurred whilst handling the file %1."), boost::filesystem::path (e.filename()).leaf()); - - boost::filesystem::space_info const s = boost::filesystem::space (e.filename()); - if (s.available < pow (1024, 3)) { - m += N_("\n\n"); - m += _("The drive that the film is stored on is low in disc space. Free some more space and try again."); + + try { + boost::filesystem::space_info const s = boost::filesystem::space (e.filename()); + if (s.available < pow (1024, 3)) { + m += N_("\n\n"); + m += _("The drive that the film is stored on is low in disc space. Free some more space and try again."); + } + } catch (...) { + } set_error (e.what(), m); -- cgit v1.2.3