forked from boostorg/regex
Added try catch block to catch runtime errors thrown from matching algorithms
[SVN r15374]
This commit is contained in:
@ -90,6 +90,7 @@ bool ogrep_predicate<iterator, Allocator>::operator()(const boost::match_results
|
|||||||
|
|
||||||
void process_grep(const char* file)
|
void process_grep(const char* file)
|
||||||
{
|
{
|
||||||
|
try{
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
mapfile f(file);
|
mapfile f(file);
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
@ -118,6 +119,14 @@ void process_grep(const char* file)
|
|||||||
cout << "File " << file << "(" << f.size() << "bytes):" << endl << "0 lines match" << endl;
|
cout << "File " << file << "(" << f.size() << "bytes):" << endl << "0 lines match" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl << e.what() << std::endl;
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user