summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-06 22:41:59 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-06 22:41:59 +0000
commit085d9d4966c32aa1f3661c597b4bc2b47eaefa40 (patch)
treea831ef56a1319cc49eb8aa50a11e87e2eb7a39c1 /src/lib
parentbfea14c1655bc4bbadbe3d9e89f4bd2ddf037659 (diff)
Catch exception thrown by checking the space on a filesystem using a non-existant file.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/job.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 8c1612a55..78a7a7577 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -69,11 +69,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);