summaryrefslogtreecommitdiff
path: root/src/exceptions.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-25 00:39:01 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-25 00:39:01 +0000
commitd4b350cc524543b8142ac803232b31af751885e2 (patch)
tree45a79c6053f536596a9712c7ae01660f7df6563d /src/exceptions.h
parent95c6dd4301da219834a7c60fec3fa92c1ec23265 (diff)
Throw exceptions with badly-formed XML when reading a DCP; preserve detail in DCPReadError.
Diffstat (limited to 'src/exceptions.h')
-rw-r--r--src/exceptions.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/exceptions.h b/src/exceptions.h
index f187df1c..3d80b635 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
@@ -35,6 +35,7 @@
#define LIBDCP_EXCEPTIONS_H
#include <boost/filesystem.hpp>
+#include <boost/optional.hpp>
/** @file src/exceptions.h
* @brief Exceptions thrown by libdcp.
@@ -97,8 +98,22 @@ class DCPReadError : public std::runtime_error
{
public:
explicit DCPReadError (std::string message)
- : std::runtime_error (message)
+ : std::runtime_error(message)
{}
+
+ DCPReadError (std::string message, std::string detail);
+
+ std::string message () const {
+ return _message;
+ }
+
+ boost::optional<std::string> detail () const {
+ return _detail;
+ }
+
+private:
+ std::string _message;
+ boost::optional<std::string> _detail;
};
/** @class MissingAssetError