}
+
SubripError::SubripError (string saw, string expecting, list<string> context)
: runtime_error ("Error in SubRip file: saw " + (saw.empty() ? "an empty string" : saw) + " when expecting " + expecting)
, _context (context)
{
}
+
+
+WebVTTError::WebVTTError(string saw, string expecting, list<string> context)
+ : runtime_error("Error in WebVTT file: saw " + (saw.empty() ? "an empty string" : saw) + " when expecting " + expecting)
+ , _context(context)
+{
+
+}
std::list<std::string> _context;
};
+
+/** @class WebVTTError
+ * @brief An error raised when reading a WebVTT file.
+ */
+class WebVTTError : public std::runtime_error
+{
+public:
+ WebVTTError(std::string message)
+ : std::runtime_error(message.c_str())
+ {}
+
+ WebVTTError(std::string saw, std::string expecting, std::list<std::string> context);
+
+ ~WebVTTError() throw () {}
+
+ std::list<std::string> context() const {
+ return _context;
+ }
+
+private:
+ std::list<std::string> _context;
+};
+
+
class SSAError : public std::runtime_error
{
public: