Reveal path in MissingAssetError.
authorCarl Hetherington <cth@carlh.net>
Tue, 22 Jan 2019 15:45:48 +0000 (15:45 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 22 Jan 2019 15:45:48 +0000 (15:45 +0000)
src/exceptions.cc
src/exceptions.h

index 5c486d09c2e05ad2270e6a7bd6900b8df2cdad10..e9cdcef1d99494968b6f491bb4a00e193e75032a 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)
 {
 
 }
index d66e89449632eb13a9d8b823464a1b2657446625..4c54ac787f4aae9f0574871fd602ebe9f03e44e0 100644 (file)
@@ -134,6 +134,13 @@ public:
 
        MissingAssetError (boost::filesystem::path, AssetType = UNKNOWN);
        ~MissingAssetError () throw () {}
+
+       boost::filesystem::path path () const {
+               return _path;
+       }
+
+private:
+       boost::filesystem::path _path;
 };
 
 class BadContentKindError : public DCPReadError