diff options
Diffstat (limited to 'src/exceptions.cc')
| -rw-r--r-- | src/exceptions.cc | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/exceptions.cc b/src/exceptions.cc index 951627a5..28846e16 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -17,13 +17,17 @@ */ +/** @file src/exceptions.cc + * @brief Exceptions thrown by libdcp. + */ + #include "exceptions.h" #include "compose.hpp" using std::string; -using namespace libdcp; +using namespace dcp; -FileError::FileError (std::string const & message, boost::filesystem::path filename, int number) +FileError::FileError (string message, boost::filesystem::path filename, int number) : _message (String::compose ("%1 (%2) (error %3)", message, filename.string(), number)) , _filename (filename) , _number (number) @@ -31,3 +35,36 @@ FileError::FileError (std::string const & message, boost::filesystem::path filen } +UnresolvedRefError::UnresolvedRefError (string id) + : _message (String::compose ("Unresolved reference to asset id %1", id)) +{ + +} + +TimeFormatError::TimeFormatError (string bad_time) + : _message (String::compose ("Bad time string %1", 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); +} |
