File tree Expand file tree Collapse file tree 2 files changed +27
-32
lines changed Expand file tree Collapse file tree 2 files changed +27
-32
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,10 @@ ArgvMap &arg()
122
122
123
123
124
124
int main (int argc, char **argv)
125
+ try
125
126
{
126
127
vector<string> lines;
127
128
128
- try {
129
129
reportAllTypes ();
130
130
reportFancyTypes ();
131
131
#if __GNUC__ >= 3
@@ -232,21 +232,19 @@ int main(int argc, char **argv)
232
232
num_domainsdone=1 ;
233
233
}
234
234
cerr<<num_domainsdone<<" domains were fully parsed, containing " <<g_numRecords<<" records\n " ;
235
+
236
+ return 0 ;
235
237
236
- }
237
- catch (AhuException &ae) {
238
- cerr<<" \n Fatal error: " <<ae.reason <<endl;
239
- return 0 ;
240
- }
241
- catch (std::exception &e) {
242
- cerr<<" died because of STL error: " <<e.what ()<<endl;
243
- exit (0 );
244
- }
245
- catch (...) {
246
- cerr<<" died because of unknown exception" <<endl;
247
- exit (0 );
248
- }
249
-
238
+ }
239
+ catch (AhuException &ae) {
240
+ cerr<<" \n Fatal error: " <<ae.reason <<endl;
241
+ return 1 ;
242
+ }
243
+ catch (std::exception &e) {
244
+ cerr<<" \n died because of STL error: " <<e.what ()<<endl;
245
+ return 1 ;
246
+ }
247
+ catch (...) {
248
+ cerr<<" \n died because of unknown exception" <<endl;
250
249
return 1 ;
251
-
252
250
}
Original file line number Diff line number Diff line change @@ -241,8 +241,8 @@ ArgvMap &arg()
241
241
242
242
243
243
int main (int argc, char **argv)
244
+ try
244
245
{
245
- try {
246
246
reportAllTypes ();
247
247
reportFancyTypes ();
248
248
#if __GNUC__ >= 3
@@ -379,26 +379,23 @@ int main(int argc, char **argv)
379
379
}
380
380
cerr<<num_domainsdone<<" domains were fully parsed, containing " <<g_numRecords<<" records\n " ;
381
381
382
- }
383
- catch (AhuException &ae) {
384
- cerr<<" \n Fatal error: " <<ae.reason <<endl;
385
- return 0 ;
386
- }
387
- catch (std::exception &e) {
388
- cerr<<" died because of STL error: " <<e.what ()<<endl;
389
- exit (0 );
390
- }
391
- catch (...) {
392
- cerr<<" died because of unknown exception" <<endl;
393
- exit (0 );
394
- }
395
-
396
382
if (::arg ().mustDo (" transactions" ) && g_intransaction) {
397
383
if (g_mode != SQLITE)
398
384
cout<<" COMMIT WORK;" <<endl;
399
385
else
400
386
cout<<" COMMIT;" <<endl;
401
387
}
388
+ return 0 ;
389
+ }
390
+ catch (AhuException &ae) {
391
+ cerr<<" \n Fatal error: " <<ae.reason <<endl;
392
+ return 1 ;
393
+ }
394
+ catch (std::exception &e) {
395
+ cerr<<" \n died because of STL error: " <<e.what ()<<endl;
396
+ return 1 ;
397
+ }
398
+ catch (...) {
399
+ cerr<<" \n died because of unknown exception" <<endl;
402
400
return 1 ;
403
-
404
401
}
You can’t perform that action at this time.
0 commit comments