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[]) {
|
||||
Options opts;
|
||||
try {
|
||||
int exitCode = parseCommandLine(argc, argv, &opts);
|
||||
if (exitCode != 0) {
|
||||
printf("Failed to parse command-line.");
|
||||
return exitCode;
|
||||
}
|
||||
try {
|
||||
return runTest(opts);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user