mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 07:07:42 -05:00
opmrst_inspect: avoid exceptions escaping main()
This commit is contained in:
1 parent
2cb6096169
commit
6fd8f8126a
1 file changed
+10
-1
@@ -29,11 +29,12 @@
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
try {
|
||||
if (argc < 2) {
|
||||
std::cerr << "Need one parameter, the .OPMRST file to inspect\n";
|
||||
return 1;
|
||||
@@ -84,3 +85,11 @@ int main(int argc, char** argv)
|
||||
|
||||
return 0;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "Exception thrown " << e.what() << std::endl;
|
||||
return 2;
|
||||
}
|
||||
catch (...) {
|
||||
std::cerr << "Unknown exception thrown" << std::endl;
|
||||
return 2;
|
||||
}
|
||||
Reference in new issue
Block a user