diff options
author | Peter Powell <petpow@saberuk.com> | 2013-08-27 07:29:13 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-08-27 12:07:49 +0100 |
commit | 0e7f74a7c8e804a0223b4d88bf637649838f0412 (patch) | |
tree | 79e0ff4d3ae3cb96ff65c52490d19afaec4916cd /include | |
parent | d9d9cbe025f94523265daa72de7596467d71f5c8 (diff) |
Make all regex modules throw the same exception on error.
Diffstat (limited to 'include')
-rw-r--r-- | include/modules/regex.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/modules/regex.h b/include/modules/regex.h index 875f942bc..e278df502 100644 --- a/include/modules/regex.h +++ b/include/modules/regex.h @@ -53,3 +53,13 @@ class RegexFactory : public DataProvider virtual Regex* Create(const std::string& expr) = 0; }; + +class RegexException : public ModuleException +{ + public: + RegexException(const std::string& regex, const std::string& error) + : ModuleException("Error in regex '" + regex + "': " + error) { } + + RegexException(const std::string& regex, const std::string& error, int offset) + : ModuleException("Error in regex '" + regex + "' at offset " + ConvToStr(offset) + ": " + error) { } +}; |