File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,17 @@ int main(int argc, char* argv[])
119119 GetModuleFileNameA (NULL , exename, sizeof (exename)/sizeof (exename[0 ])-1 );
120120 argv[0 ] = exename;
121121#endif
122- return exec.check (argc, argv);
122+
123+ try {
124+ return exec.check (argc, argv);
125+ } catch (const InternalError& e) {
126+ printf (" %s\n " , e.errorMessage .c_str ());
127+ } catch (const std::exception& error) {
128+ printf (" %s\n " , error.what ());
129+ } catch (...) {
130+ printf (" Unknown exception\n " );
131+ }
132+ return EXIT_FAILURE;
123133}
124134
125135
Original file line number Diff line number Diff line change 2222
2323int main (int argc, char *argv[])
2424{
25- options args (argc, const_cast <const char **>(argv));
25+ try {
26+ options args (argc, const_cast <const char **>(argv));
2627
27- std::size_t failedTestsCount = TestFixture::runTests (args);
28-
29- return (failedTestsCount == 0 ) ? EXIT_SUCCESS : EXIT_FAILURE;
28+ std::size_t failedTestsCount = TestFixture::runTests (args);
29+ return (failedTestsCount == 0 ) ? EXIT_SUCCESS : EXIT_FAILURE;
30+ } catch (const InternalError& e) {
31+ printf (" %s\n " , e.errorMessage .c_str ());
32+ } catch (const std::exception& error) {
33+ printf (" %s\n " , error.what ());
34+ } catch (...) {
35+ printf (" Unknown exception\n " );
36+ }
37+ return EXIT_FAILURE;
3038}
You can’t perform that action at this time.
0 commit comments