Merge pull request #4 from tschiemer/master
[libdcp.git] / src / exceptions.cc
index 5c486d09c2e05ad2270e6a7bd6900b8df2cdad10..7516d0858577050f1f29ce82d9f57b79d715dd66 100644 (file)
@@ -64,10 +64,11 @@ TimeFormatError::TimeFormatError (string bad_time)
 
 MissingAssetError::MissingAssetError (boost::filesystem::path path, AssetType type)
        : DCPReadError (
-               type == MAIN_PICTURE    ? String::compose ("Missing asset %1 for main picture", path.string()) :
-               (type == MAIN_SOUND     ? String::compose ("Missing asset %1 for main sound", path.string()) :
-                (type == MAIN_SUBTITLE ? String::compose ("Missing asset %1 for main subtitle", path.string()) :
-                 String::compose ("Missing asset %1", path.string()))))
+               type == MAIN_PICTURE    ? String::compose ("Missing asset %1 for main picture", path.filename().string()) :
+               (type == MAIN_SOUND     ? String::compose ("Missing asset %1 for main sound", path.filename().string()) :
+                (type == MAIN_SUBTITLE ? String::compose ("Missing asset %1 for main subtitle", path.filename().string()) :
+                 String::compose ("Missing asset %1", path.filename().string()))))
+       , _path (path)
 {
 
 }
@@ -109,7 +110,7 @@ KDMFormatError::KDMFormatError (std::string message)
 
 }
 
-CertificateChainError::CertificateChainError (std::string message)
+CertificateChainError::CertificateChainError (string message)
        : runtime_error (message)
 {
 
@@ -122,3 +123,9 @@ DCPReadError::DCPReadError (string message, string detail)
 {
 
 }
+
+MissingSubtitleImageError::MissingSubtitleImageError (string id)
+       : runtime_error (String::compose("Could not load image for subtitle %1", id))
+{
+
+}