summaryrefslogtreecommitdiff
path: root/src/exceptions.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-09-20 21:07:57 +0100
committerCarl Hetherington <cth@carlh.net>2016-09-20 21:07:57 +0100
commit79e49c267f3e51126ad7d6c936de2da5455a9894 (patch)
tree3dccc85f0017c88e69d7a192769c7ae26a6e027e /src/exceptions.cc
parentf36f586f6e66c7b9414f49524a7c565b7ccce4cc (diff)
Give a more informative exception on SubRip parse failures.
Diffstat (limited to 'src/exceptions.cc')
-rw-r--r--src/exceptions.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/exceptions.cc b/src/exceptions.cc
index 4d9d29f..d59d32a 100644
--- a/src/exceptions.cc
+++ b/src/exceptions.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2016 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
@@ -19,8 +19,10 @@
#include "compose.hpp"
#include "exceptions.h"
+#include <boost/foreach.hpp>
using std::string;
+using std::list;
using namespace sub;
ProgrammingError::ProgrammingError (string file, int line)
@@ -28,3 +30,10 @@ ProgrammingError::ProgrammingError (string file, int 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)
+{
+
+}