Skip to content
Snippets Groups Projects
Commit 4b78bf49 authored by Karsten Suehring's avatar Karsten Suehring
Browse files

revise exception handling in release mode

- catch std::bad_alloc explicitly
- remove catch-all handler
parent a6bd8b15
No related branches found
No related tags found
No related merge requests found
......@@ -100,9 +100,9 @@ int main(int argc, char* argv[])
std::cerr << e.what() << std::endl;
returnCode = EXIT_FAILURE;
}
catch( ... )
catch (const std::bad_alloc &e)
{
std::cerr << "Unspecified error occurred" << std::endl;
std::cout << "Memory allocation failed: " << e.what() << std::endl;
returnCode = EXIT_FAILURE;
}
#endif
......
......@@ -156,12 +156,12 @@ int main(int argc, char* argv[])
catch( Exception &e )
{
std::cerr << e.what() << std::endl;
return 1;
return EXIT_FAILURE;
}
catch( ... )
catch (const std::bad_alloc &e)
{
std::cerr << "Unspecified error occurred" << std::endl;
return 1;
std::cout << "Memory allocation failed: " << e.what() << std::endl;
return EXIT_FAILURE;
}
#endif
// ending time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment