diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpl.cc | 4 | ||||
| -rw-r--r-- | src/exceptions.cc | 8 | ||||
| -rw-r--r-- | src/exceptions.h | 6 |
3 files changed, 18 insertions, 0 deletions
@@ -198,6 +198,10 @@ CPL::write_xml (boost::filesystem::path file, Standard standard, shared_ptr<cons auto reel_list = root->add_child ("ReelList"); + if (_reels.empty()) { + throw NoReelsError (); + } + bool first = true; for (auto i: _reels) { auto asset_list = i->write_to_cpl (reel_list, standard); diff --git a/src/exceptions.cc b/src/exceptions.cc index ebe8609a..37e699e6 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -169,3 +169,11 @@ UnknownChannelIdError::UnknownChannelIdError (std::string id) { } + + +NoReelsError::NoReelsError () + : runtime_error ("Cannot make a DCP when no reels have been added") +{ + +} + diff --git a/src/exceptions.h b/src/exceptions.h index b9bcfd37..76a66808 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -283,6 +283,12 @@ public: }; +class NoReelsError : public std::runtime_error +{ +public: + NoReelsError (); +}; + } #endif |
