Catch exceptions when checking disk space.
authorCarl Hetherington <cth@carlh.net>
Fri, 12 Apr 2013 19:29:27 +0000 (20:29 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 Apr 2013 19:29:27 +0000 (20:29 +0100)
src/lib/job.cc

index ff0332d6daeee092ca29cc6c720bfb0098b6d30c..f830975af443102509683b5f9c2812e4208cfd80 100644 (file)
@@ -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);