diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-05-03 11:17:34 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-03 20:18:04 +0200 |
| commit | 689fa55d1529ad88449ca464e9107c4dcc54d1cb (patch) | |
| tree | edd1264941263f2fa25a98d61f98c87876c5b667 /src/lib/exceptions.h | |
| parent | 0aabe4060ea4bad7c7caac633aef0737fccff8c2 (diff) | |
C++11 tidying.
Diffstat (limited to 'src/lib/exceptions.h')
| -rw-r--r-- | src/lib/exceptions.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 5b7baf0e5..93be3999b 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,21 +18,25 @@ */ + /** @file src/lib/exceptions.h * @brief Our exceptions. */ + #ifndef DCPOMATIC_EXCEPTIONS_H #define DCPOMATIC_EXCEPTIONS_H + #include "compose.hpp" extern "C" { #include <libavutil/pixfmt.h> } #include <boost/filesystem.hpp> #include <boost/optional.hpp> -#include <stdexcept> #include <cstring> +#include <stdexcept> + /** @class DecodeError * @brief A low-level problem with the decoder (possibly due to the nature @@ -45,15 +49,16 @@ public: : std::runtime_error (s) {} - explicit DecodeError (std::string function, std::string caller) + DecodeError (std::string function, std::string caller) : std::runtime_error (String::compose("%1 failed [%2", function, caller)) {} - explicit DecodeError (std::string function, std::string caller, int error) + DecodeError (std::string function, std::string caller, int error) : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error)) {} }; + class CryptoError : public std::runtime_error { public: @@ -109,6 +114,7 @@ private: boost::filesystem::path _file; }; + class JoinError : public std::runtime_error { public: @@ -117,6 +123,7 @@ public: {} }; + /** @class OpenFileError. * @brief Indicates that some error occurred when trying to open a file. */ @@ -136,6 +143,7 @@ public: OpenFileError (boost::filesystem::path f, int error, Mode mode); }; + class FileNotFoundError : public std::runtime_error { public: @@ -152,6 +160,7 @@ private: boost::filesystem::path _file; }; + /** @class ReadFileError. * @brief Indicates that some error occurred when trying to read from a file */ @@ -164,6 +173,7 @@ public: ReadFileError (boost::filesystem::path f, int e = 0); }; + /** @class WriteFileError. * @brief Indicates that some error occurred when trying to write to a file */ @@ -176,6 +186,7 @@ public: WriteFileError (boost::filesystem::path f, int e); }; + /** @class SettingError. * @brief Indicates that something is wrong with a setting. */ @@ -201,6 +212,7 @@ private: std::string _setting; }; + /** @class MissingSettingError. * @brief Indicates that a Film is missing a setting that is required for some operation. */ @@ -211,6 +223,7 @@ public: explicit MissingSettingError (std::string s); }; + /** @class BadSettingError * @brief Indicates that a setting is bad in some way. */ @@ -225,6 +238,7 @@ public: {} }; + /** @class NetworkError * @brief Indicates some problem with communication on the network. */ @@ -236,6 +250,7 @@ public: {} }; + /** @class KDMError * @brief A problem with a KDM. */ @@ -258,6 +273,7 @@ private: std::string _detail; }; + /** @class PixelFormatError * @brief A problem with an unsupported pixel format. */ @@ -267,6 +283,7 @@ public: PixelFormatError (std::string o, AVPixelFormat f); }; + /** @class TextSubtitleError * @brief An error that occurs while parsing a TextSubtitleError file. */ @@ -276,6 +293,7 @@ public: TextSubtitleError (std::string, std::string, boost::filesystem::path); }; + class DCPError : public std::runtime_error { public: @@ -307,11 +325,13 @@ public: }; class ProgrammingError : public std::runtime_error + { public: ProgrammingError (std::string file, int line, std::string message = ""); }; + class TextEncodingError : public std::runtime_error { public: @@ -320,6 +340,7 @@ public: {} }; + class MetadataError : public std::runtime_error { public: @@ -328,6 +349,7 @@ public: {} }; + class OldFormatError : public std::runtime_error { public: @@ -336,18 +358,21 @@ public: {} }; + class KDMAsContentError : public std::runtime_error { public: KDMAsContentError (); }; + class GLError : public std::runtime_error { public: GLError (char const * last, int e); }; + /** @class CopyError * @brief An error which occurs when copying a DCP to a distribution drive. */ @@ -412,4 +437,5 @@ public: {} }; + #endif |
