2 Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef LIBSUB_EXCEPTIONS_H
21 #define LIBSUB_EXCEPTIONS_H
31 * @brief An error raised when reading an XML file.
33 class XMLError : public std::runtime_error
36 XMLError (std::string const & message)
37 : std::runtime_error (message)
42 * @brief An error raised when reading a binary STL file.
44 class STLError : public std::runtime_error
47 STLError (std::string const & message)
48 : std::runtime_error (message)
52 /** @class SubripError
53 * @brief An error raised when reading a Subrip file.
55 class SubripError : public std::runtime_error
58 SubripError (std::string saw, std::string expecting, std::list<std::string> context);
59 ~SubripError () throw () {}
61 std::list<std::string> context () const {
66 std::list<std::string> _context;
70 /** @class WebVTTError
71 * @brief An error raised when reading a WebVTT file.
73 class WebVTTError : public std::runtime_error
76 WebVTTError(std::string message)
77 : std::runtime_error(message.c_str())
80 WebVTTError(std::string saw, std::string expecting, std::list<std::string> context);
82 ~WebVTTError() throw () {}
84 std::list<std::string> context() const {
89 std::list<std::string> _context;
93 class SSAError : public std::runtime_error
96 SSAError (std::string message)
97 : std::runtime_error(message)
101 class MXFError : public std::runtime_error
104 MXFError (std::string const & message)
105 : std::runtime_error (message)
109 class UnknownFrameRateError : public std::runtime_error
112 UnknownFrameRateError ()
113 : std::runtime_error ("unknown frame rate")
117 class ProgrammingError : public std::runtime_error
120 ProgrammingError (std::string file, int line);