Use exceptions to hold errors even in the keep_going case.
[libdcp.git] / src / exceptions.cc
index 48da4fcd34077aafc00b8ef2ba45f64b0331df91..28846e1617b0523a43f31b7fcaf0f897ee91f518 100644 (file)
@@ -47,4 +47,24 @@ TimeFormatError::TimeFormatError (string bad_time)
 
 }
 
-                           
+MissingAssetError::MissingAssetError (boost::filesystem::path path, AssetType type)
+       : _path (path)
+       , _type (type)
+{
+       string type_name;
+       switch (_type) {
+       case MAIN_PICTURE:
+               type_name = " for main picture";
+               break;
+       case MAIN_SOUND:
+               type_name = " for main sound";
+               break;
+       case MAIN_SUBTITLE:
+               type_name = " for main subtitle";
+               break;
+       case UNKNOWN:
+               break;
+       }
+       
+       _message = String::compose ("Missing asset %1%2", path.string(), type_name);
+}