X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fexceptions.h;h=52f257a8d3f558550ccba9724dfe612e3eca55c0;hb=5ea52a08f45b0cb8b8fe7221244cdcdeeaca0ed7;hp=61163c8d12403dc492251f3e85668b4fa9a1119e;hpb=015fe447cfe25babc55cf8ed282bb909e4713aa0;p=dcpomatic.git diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 61163c8d1..52f257a8d 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington 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 @@ -17,13 +17,13 @@ */ -#ifndef DCPOMATIC_EXCEPTIONS_H -#define DCPOMATIC_EXCEPTIONS_H - -/** @file src/exceptions.h +/** @file src/lib/exceptions.h * @brief Our exceptions. */ +#ifndef DCPOMATIC_EXCEPTIONS_H +#define DCPOMATIC_EXCEPTIONS_H + #include #include #include @@ -205,7 +205,7 @@ public: {} }; -/** @class NetworkError. +/** @class NetworkError * @brief Indicates some problem with communication on the network. */ class NetworkError : public StringError @@ -216,6 +216,9 @@ public: {} }; +/** @class KDMError + * @brief A problem with a KDM. + */ class KDMError : public StringError { public: @@ -224,22 +227,44 @@ public: {} }; +/** @class PixelFormatError + * @brief A problem with an unsupported pixel format. + */ class PixelFormatError : public StringError { public: PixelFormatError (std::string o, AVPixelFormat f); }; -/** An error that occurs while parsing a SubRip file */ +/** @class SubRipError + * @brief An error that occurs while parsing a SubRip file. + */ class SubRipError : public FileError { public: SubRipError (std::string, std::string, boost::filesystem::path); }; -/** A parent class for classes which have a need to catch and - * re-throw exceptions. This is intended for classes - * which run their own thread; they should do something like +class DCPError : public StringError +{ +public: + DCPError (std::string s) + : StringError (s) + {} +}; + +class InvalidSignerError : public StringError +{ +public: + InvalidSignerError (); +}; + +/** @class ExceptionStore + * @brief A parent class for classes which have a need to catch and + * re-throw exceptions. + * + * This is intended for classes which run their own thread; they should do + * something like * * void my_thread () * try { @@ -260,6 +285,7 @@ public: boost::mutex::scoped_lock lm (_mutex); if (_exception) { boost::rethrow_exception (_exception); + _exception = boost::exception_ptr (); } } @@ -275,6 +301,4 @@ private: mutable boost::mutex _mutex; }; - - #endif