diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/exceptions.cc | 8 | ||||
| -rw-r--r-- | src/exceptions.h | 6 | ||||
| -rw-r--r-- | src/util.cc | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/exceptions.cc b/src/exceptions.cc index 1ded4483..5c486d09 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -72,6 +72,12 @@ MissingAssetError::MissingAssetError (boost::filesystem::path path, AssetType ty } +BadContentKindError::BadContentKindError (string content_kind) + : DCPReadError (String::compose("Bad content kind '%1'", content_kind)) +{ + +} + NotEncryptedError::NotEncryptedError (string const & what) : runtime_error (String::compose ("%1 is not encrypted", what)) { diff --git a/src/exceptions.h b/src/exceptions.h index 8bc6e550..d66e8944 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -136,6 +136,12 @@ public: ~MissingAssetError () throw () {} }; +class BadContentKindError : public DCPReadError +{ +public: + BadContentKindError (std::string content_kind); +}; + /** @class XMLError * @brief An XML error */ diff --git a/src/util.cc b/src/util.cc index 3d90ccaa..ac97af6e 100644 --- a/src/util.cc +++ b/src/util.cc @@ -214,7 +214,7 @@ dcp::content_kind_from_string (string kind) return ADVERTISEMENT; } - DCP_ASSERT (false); + throw BadContentKindError (kind); } /** @param s A string. |
