Give a better error when opening a DCP with File -> Open by mistake (#1723).
[dcpomatic.git] / src / lib / film.cc
index 90b18ea707eb3e20c043160e482b18a8704c9688..691ef58dab1012f0b2dfb8c96d7b141e7b34ffc2 100644 (file)
@@ -475,6 +475,10 @@ Film::read_metadata (optional<boost::filesystem::path> path)
                path = file (metadata_file);
        }
 
+       if (!boost::filesystem::exists(*path)) {
+               throw FileNotFoundError(*path);
+       }
+
        cxml::Document f ("Metadata");
        f.read_file (path.get ());