From: Carl Hetherington Date: Thu, 1 Jun 2017 22:46:11 +0000 (+0100) Subject: Improve an error message. X-Git-Tag: v2.11.10~4 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=70c0dfe78b63b4f9e3bc164cff47dbf0dd213519;hp=6ab8e99f22bfe61bddbd204d4265071729c1f37d;p=dcpomatic.git Improve an error message. --- diff --git a/src/lib/exceptions.cc b/src/lib/exceptions.cc index cf3708896..4e1e1ade3 100644 --- a/src/lib/exceptions.cc +++ b/src/lib/exceptions.cc @@ -81,8 +81,8 @@ InvalidSignerError::InvalidSignerError (string reason) } -ProgrammingError::ProgrammingError (string file, int line) - : runtime_error (String::compose (_("Programming error at %1:%2"), file, line)) +ProgrammingError::ProgrammingError (string file, int line, string message) + : runtime_error (String::compose (_("Programming error at %1:%2 %3"), file, line, message)) { } diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index c1b1aef4b..08cbcb1d6 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -233,7 +233,7 @@ public: class ProgrammingError : public std::runtime_error { public: - ProgrammingError (std::string file, int line); + ProgrammingError (std::string file, int line, std::string message = ""); }; class TextEncodingError : public std::runtime_error diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 2c74d66bd..27f10d1ed 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -361,7 +361,12 @@ ReelWriter::create_reel (list const & refs, listduration() == _period.duration().frames_round (_film->video_frame_rate ())); + if (reel_picture_asset->duration() != _period.duration().frames_round (_film->video_frame_rate ())) { + throw ProgrammingError ( + __FILE__, __LINE__, + String::compose ("%1 vs %2", reel_picture_asset->duration(), _period.duration().frames_round (_film->video_frame_rate ())) + ); + } reel->add (reel_picture_asset); /* If we have a hash for this asset in the CPL, assume that it is correct */