mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
tools: add catches for C++ exceptions
This commit is contained in:
parent
b5a8644b1f
commit
229f3d5080
10
src/grey.cpp
10
src/grey.cpp
@ -198,7 +198,15 @@ void applyGreyOverrides(Grey *g, const string &s) {
|
|||||||
|
|
||||||
string::const_iterator ve = find(ke, pe, ';');
|
string::const_iterator ve = find(ke, pe, ';');
|
||||||
|
|
||||||
unsigned int value = lexical_cast<unsigned int>(string(ke + 1, ve));
|
unsigned int value = 0;
|
||||||
|
try {
|
||||||
|
value = lexical_cast<unsigned int>(string(ke + 1, ve));
|
||||||
|
} catch (boost::bad_lexical_cast &e) {
|
||||||
|
printf("Invalid grey override key %s:%s\n", key.c_str(),
|
||||||
|
string(ke + 1, ve).c_str());
|
||||||
|
invalid_key_seen = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
bool done = false;
|
bool done = false;
|
||||||
|
|
||||||
/* surely there exists a nice template to go with this macro to make
|
/* surely there exists a nice template to go with this macro to make
|
||||||
|
@ -1065,6 +1065,9 @@ int HS_CDECL main(int argc, char *argv[]) {
|
|||||||
} catch (const SqlFailure &f) {
|
} catch (const SqlFailure &f) {
|
||||||
cerr << f.message << '\n';
|
cerr << f.message << '\n';
|
||||||
return -1;
|
return -1;
|
||||||
|
} catch (const std::runtime_error &e) {
|
||||||
|
cerr << "Internal error: " << e.what() << '\n';
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user