summaryrefslogtreecommitdiff
path: root/src/exceptions.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/exceptions.h')
-rw-r--r--src/exceptions.h52
1 files changed, 40 insertions, 12 deletions
diff --git a/src/exceptions.h b/src/exceptions.h
index 2070dd0f..bc5e83d1 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,14 +26,16 @@
* @brief Exceptions thrown by libdcp.
*/
-namespace libdcp
+namespace dcp
{
-/** @brief An exception related to a file */
+/** @class FileError
+ * @brief An exception related to a file
+ */
class FileError : public std::exception
{
public:
- FileError (std::string const & message, boost::filesystem::path filename, int number);
+ FileError (std::string message, boost::filesystem::path filename, int number);
~FileError () throw () {}
/** @return error message */
@@ -59,20 +61,24 @@ private:
int _number;
};
-/** @brief An exception related to an MXF file */
+/** @class MXFFileError
+ * @brief An exception related to an MXF file
+ */
class MXFFileError : public FileError
{
public:
- MXFFileError (std::string const & message, boost::filesystem::path filename, int number)
+ MXFFileError (std::string message, boost::filesystem::path filename, int number)
: FileError (message, filename, number)
{}
};
-/** @brief A miscellaneous exception */
+/** @class MiscError
+ * @brief A miscellaneous exception
+ */
class MiscError : public std::exception
{
public:
- MiscError (std::string const & message) : _message (message) {}
+ MiscError (std::string message) : _message (message) {}
~MiscError () throw () {}
/** @return error message */
@@ -85,11 +91,13 @@ private:
std::string _message;
};
-/** @brief A DCP read exception */
+/** @class DCPReadError
+ * @brief A DCP read exception
+ */
class DCPReadError : public std::exception
{
public:
- DCPReadError (std::string const & message) : _message (message) {}
+ DCPReadError (std::string message) : _message (message) {}
~DCPReadError () throw () {}
/** @return error message */
@@ -102,11 +110,13 @@ private:
std::string _message;
};
-/** @brief An XML error */
+/** @class XMLError
+ * @brief An XML error
+ */
class XMLError : public std::exception
{
public:
- XMLError (std::string const & message) : _message (message) {}
+ XMLError (std::string message) : _message (message) {}
~XMLError () throw () {}
/** @return error message */
@@ -118,6 +128,24 @@ private:
/** error message */
std::string _message;
};
+
+/** @class UnresolvedRefError
+ * @brief An exception caused by a reference (by UUID) to something which is not known
+ */
+class UnresolvedRefError : public std::exception
+{
+public:
+ UnresolvedRefError (std::string id);
+ ~UnresolvedRefError () throw () {}
+
+ /** @return error message */
+ char const * what () const throw () {
+ return _message.c_str ();
+ }
+
+private:
+ std::string _message;
+};
}