summaryrefslogtreecommitdiff
path: root/src/exceptions.h
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.h
parentf36f586f6e66c7b9414f49524a7c565b7ccce4cc (diff)
Give a more informative exception on SubRip parse failures.
Diffstat (limited to 'src/exceptions.h')
-rw-r--r--src/exceptions.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/exceptions.h b/src/exceptions.h
index c6f7f1a..c7a3c71 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 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
@@ -22,6 +22,7 @@
#include <stdexcept>
#include <string>
+#include <list>
namespace sub {
@@ -53,9 +54,14 @@ public:
class SubripError : public std::runtime_error
{
public:
- SubripError (std::string saw, std::string expecting)
- : std::runtime_error ("Error in SubRip file: saw " + saw + " while expecting " + expecting)
- {}
+ SubripError (std::string saw, std::string expecting, std::list<std::string> context);
+
+ std::list<std::string> context () const {
+ return _context;
+ }
+
+private:
+ std::list<std::string> _context;
};
class MXFError : public std::runtime_error