diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2015-08-15 17:02:26 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2015-08-15 17:02:48 +0200 |
commit | dbe655d159998b7dd0f75cca75129a8e7ee1f8d1 (patch) | |
tree | 478bad95e597a7dd97773ddba58f79b71701ed7a /src | |
parent | 51768b9f7a582fee2ddd7a45da1fb2946a202cfe (diff) |
regex filter: log the problematic strings so they can be identified
Diffstat (limited to 'src')
-rw-r--r-- | src/regex_filter.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/regex_filter.h b/src/regex_filter.h index a0bbabcf..8b3f3c0a 100644 --- a/src/regex_filter.h +++ b/src/regex_filter.h @@ -30,6 +30,7 @@ #endif // BOOST_REGEX_ICU #include <cassert> +#include <iostream> namespace Regex { @@ -64,8 +65,9 @@ inline bool search(StringT &&s, const Regex &rx) boost::regex_search # endif // BOOST_REGEX_ICU (std::forward<StringT>(s), rx); - } catch (std::out_of_range &) { + } catch (std::out_of_range &e) { // Invalid UTF-8 sequence, ignore the string. + std::cerr << "Regex::search: error while processing \"" << s << "\": " << e.what() << "\n"; return false; } } |