Remove use of boost foreach.
[libsub.git] / src / exceptions.cc
index f33a1e2b1f16865e7976f3faaed870312c331948..72198fcefffe0bbfe4689b38b84bfe39fc84c332 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     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
 #include "compose.hpp"
 #include "exceptions.h"
 
+using std::list;
 using std::string;
 using namespace sub;
 
 ProgrammingError::ProgrammingError (string file, int line)
-       : MessageError (String::compose ("Programming error at %1:%2", file, line))
+       : runtime_error (String::compose ("Programming error at %1:%2", file, line))
+{
+
+}
+
+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)
 {
 
 }