Skip to content
Snippets Groups Projects
Commit 5dd823b3 authored by Frank Bossen's avatar Frank Bossen
Browse files

Merge branch 'exception_handling' into 'master'

revise exception handling in release mode

See merge request !893
parents a6bd8b15 4b78bf49
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