From: Carl Hetherington Date: Tue, 22 Jan 2019 15:45:48 +0000 (+0000) Subject: Reveal path in MissingAssetError. X-Git-Tag: v1.6.2~10 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=49f9ec23d00bec2f284118fed3d48d10a6cc8537;p=libdcp.git Reveal path in MissingAssetError. --- diff --git a/src/exceptions.cc b/src/exceptions.cc index 5c486d09..e9cdcef1 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -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) { } diff --git a/src/exceptions.h b/src/exceptions.h index d66e8944..4c54ac78 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -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