Report errors passed back from DCP::read when exceptions aren't used.
[libdcp.git] / src / exceptions.h
index d66e89449632eb13a9d8b823464a1b2657446625..17b18eb2876f38ee74b58bc85524e099d545bb75 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
@@ -134,6 +134,13 @@ public:
 
        MissingAssetError (boost::filesystem::path, AssetType = UNKNOWN);
        ~MissingAssetError () throw () {}
+
+       boost::filesystem::path path () const {
+               return _path;
+       }
+
+private:
+       boost::filesystem::path _path;
 };
 
 class BadContentKindError : public DCPReadError
@@ -215,6 +222,31 @@ public:
        CertificateChainError (std::string message);
 };
 
+class MissingSubtitleImageError : public std::runtime_error
+{
+public:
+       MissingSubtitleImageError (std::string id);
+};
+
+class EmptyAssetPathError : public DCPReadError
+{
+public:
+       EmptyAssetPathError (std::string id);
+};
+
+class BadKDMDateError : public std::runtime_error
+{
+public:
+       BadKDMDateError (bool starts_too_early);
+
+       bool starts_too_early () const {
+               return _starts_too_early;
+       }
+
+private:
+       bool _starts_too_early;
+};
+
 }
 
 #endif