mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-19 16:56:08 +01:00
parseCommandLine also throws
Catching exceptions thrown by parseCommandLine (std::bad_alloc & std::length_error) also.
This commit is contained in:
parent
cc5cdb565c
commit
6c14548293
@ -310,12 +310,12 @@ static int runTest(Options const& opts)
|
|||||||
}
|
}
|
||||||
int main(int argc, const char* argv[]) {
|
int main(int argc, const char* argv[]) {
|
||||||
Options opts;
|
Options opts;
|
||||||
|
try {
|
||||||
int exitCode = parseCommandLine(argc, argv, &opts);
|
int exitCode = parseCommandLine(argc, argv, &opts);
|
||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
printf("Failed to parse command-line.");
|
printf("Failed to parse command-line.");
|
||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
return runTest(opts);
|
return runTest(opts);
|
||||||
}
|
}
|
||||||
catch (const std::exception& e) {
|
catch (const std::exception& e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user