More detailed error with an invalid signer chain.
authorCarl Hetherington <cth@carlh.net>
Tue, 4 Apr 2017 23:12:59 +0000 (00:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 4 Apr 2017 23:12:59 +0000 (00:12 +0100)
cscript
src/lib/exceptions.cc
src/lib/exceptions.h
src/lib/writer.cc

diff --git a/cscript b/cscript
index 480f4b91ba7b65ef3f6cca833d10f7318040d589..5c50f476e99765c4eae7958ece869a13b167b51e 100644 (file)
--- a/cscript
+++ b/cscript
@@ -270,7 +270,7 @@ def dependencies(target):
         ffmpeg_options = {}
 
     return (('ffmpeg-cdist', 'c7df8d5', ffmpeg_options),
-            ('libdcp', 'ce32d6c'),
+            ('libdcp', '45fd755'),
             ('libsub', '733dfda'))
 
 def configure_options(target):
index cef6e7447f765ad8430b89783e632b7217ca1472..4590531b7bd5a8cabe73d70650dd5b96467083bd 100644 (file)
@@ -75,6 +75,12 @@ InvalidSignerError::InvalidSignerError ()
 
 }
 
+InvalidSignerError::InvalidSignerError (string reason)
+       : runtime_error (String::compose (_("The certificate chain for signing is invalid (%1)"), reason))
+{
+
+}
+
 ProgrammingError::ProgrammingError (string file, int line)
        : runtime_error (String::compose (_("Programming error at %1:%2"), file, line))
 {
index 98727e0cc33c5deb4be8cfd70ed2f938ba37fcec..99a8c0dc47dcb585b95a25f436e64c1fdee3c85b 100644 (file)
@@ -225,6 +225,7 @@ class InvalidSignerError : public std::runtime_error
 {
 public:
        InvalidSignerError ();
+       InvalidSignerError (std::string reason);
 };
 
 class ProgrammingError : public std::runtime_error
index 595915883228021dd49f86ce920ea9aa4f9492c0..6e6bedb8f6aedaed378a807cbc818edf217c3411 100644 (file)
@@ -95,8 +95,9 @@ Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j)
        _subtitle_reel = _reels.begin ();
 
        /* Check that the signer is OK if we need one */
-       if (_film->is_signed() && !Config::instance()->signer_chain()->valid ()) {
-               throw InvalidSignerError ();
+       string reason;
+       if (_film->is_signed() && !Config::instance()->signer_chain()->valid(&reason)) {
+               throw InvalidSignerError (reason);
        }
 }
 
@@ -510,8 +511,9 @@ Writer::finish ()
        if (_film->is_signed ()) {
                signer = Config::instance()->signer_chain ();
                /* We did check earlier, but check again here to be on the safe side */
-               if (!signer->valid ()) {
-                       throw InvalidSignerError ();
+               string reason;
+               if (!signer->valid (&reason)) {
+                       throw InvalidSignerError (reason);
                }
        }