X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fexceptions.h;h=08cbcb1d66bf6a593be12c84af52fd2479b5816b;hb=d66bcea066deb3b3cd919a69aab7e2078fb52ca8;hp=da87613042f18cf91fa04e32f37dea80951c30b4;hpb=e0adfd85dd7987ee2b77eea7f6d3c13885729a38;p=dcpomatic.git diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index da8761304..08cbcb1d6 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -1,19 +1,20 @@ /* Copyright (C) 2012-2014 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ @@ -94,21 +95,13 @@ public: class OpenFileError : public FileError { public: - /** @param f File that we were trying to open */ - OpenFileError (boost::filesystem::path f); -}; - -/** @class CreateFileError. - * @brief Indicates that some error occurred when trying to create a file. - */ -class CreateFileError : public FileError -{ -public: - /** @param f File that we were trying to create */ - CreateFileError (boost::filesystem::path f); + /** @param f File that we were trying to open. + * @param error Code of error that occurred. + * @param reading true if we were opening to read, false if opening to write. + */ + OpenFileError (boost::filesystem::path f, int error, bool reading); }; - /** @class ReadFileError. * @brief Indicates that some error occurred when trying to read from a file */ @@ -174,7 +167,9 @@ public: class BadSettingError : public SettingError { public: - /** @param s Name of setting that is bad */ + /** @param s Name of setting that is bad. + * @param m Error message. + */ BadSettingError (std::string s, std::string m) : SettingError (s, m) {} @@ -211,13 +206,13 @@ public: PixelFormatError (std::string o, AVPixelFormat f); }; -/** @class SubRipError - * @brief An error that occurs while parsing a SubRip file. +/** @class TextSubtitleError + * @brief An error that occurs while parsing a TextSubtitleError file. */ -class SubRipError : public FileError +class TextSubtitleError : public FileError { public: - SubRipError (std::string, std::string, boost::filesystem::path); + TextSubtitleError (std::string, std::string, boost::filesystem::path); }; class DCPError : public std::runtime_error @@ -232,12 +227,13 @@ class InvalidSignerError : public std::runtime_error { public: InvalidSignerError (); + InvalidSignerError (std::string reason); }; class ProgrammingError : public std::runtime_error { public: - ProgrammingError (std::string file, int line); + ProgrammingError (std::string file, int line, std::string message = ""); }; class TextEncodingError : public std::runtime_error @@ -248,4 +244,18 @@ public: {} }; +class OldFormatError : public std::runtime_error +{ +public: + OldFormatError (std::string s) + : std::runtime_error (s) + {} +}; + +class KDMAsContentError : public std::runtime_error +{ +public: + KDMAsContentError (); +}; + #endif