From 09512a7cb428ddb7e092a67697aebcf422f8dba1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 14 Nov 2022 00:32:16 +0100 Subject: Add exception missing from previous commit. --- src/exceptions.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/exceptions.h') diff --git a/src/exceptions.h b/src/exceptions.h index a032252..2b2b09c 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -66,6 +66,30 @@ private: std::list _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 context); + + ~WebVTTError() throw () {} + + std::list context() const { + return _context; + } + +private: + std::list _context; +}; + + class SSAError : public std::runtime_error { public: -- cgit v1.2.3