Catch all exceptions in the editors in order to show an error dialog.
(This is the same as what the game already does.)
This commit is contained in:
@@ -101,6 +101,7 @@ cScenario scenario;
|
|||||||
|
|
||||||
//MW specified return type was 'void', changed to ISO C style for Carbonisation -jmr
|
//MW specified return type was 'void', changed to ISO C style for Carbonisation -jmr
|
||||||
int main(int /*argc*/, char* argv[]) {
|
int main(int /*argc*/, char* argv[]) {
|
||||||
|
try {
|
||||||
init_menubar();
|
init_menubar();
|
||||||
init_directories(argv[0]);
|
init_directories(argv[0]);
|
||||||
Initialize();
|
Initialize();
|
||||||
@@ -117,7 +118,17 @@ int main(int /*argc*/, char* argv[]) {
|
|||||||
|
|
||||||
while(!All_Done)
|
while(!All_Done)
|
||||||
Handle_One_Event();
|
Handle_One_Event();
|
||||||
return 0;
|
return 0;
|
||||||
|
} catch(std::exception& x) {
|
||||||
|
giveError(x.what());
|
||||||
|
throw;
|
||||||
|
} catch(std::string& x) {
|
||||||
|
giveError(x);
|
||||||
|
throw;
|
||||||
|
} catch(...) {
|
||||||
|
giveError("An unknown error occurred!");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -78,6 +78,7 @@ rectangle right_sbar_rect;
|
|||||||
|
|
||||||
//Changed to ISO C specified argument and return type.
|
//Changed to ISO C specified argument and return type.
|
||||||
int main(int, char* argv[]) {
|
int main(int, char* argv[]) {
|
||||||
|
try {
|
||||||
init_menubar();
|
init_menubar();
|
||||||
//outdoor_record_type dummy_outdoor, *store2;
|
//outdoor_record_type dummy_outdoor, *store2;
|
||||||
|
|
||||||
@@ -132,7 +133,17 @@ int main(int, char* argv[]) {
|
|||||||
Handle_One_Event();
|
Handle_One_Event();
|
||||||
|
|
||||||
close_program();
|
close_program();
|
||||||
return 0;
|
return 0;
|
||||||
|
} catch(std::exception& x) {
|
||||||
|
giveError(x.what());
|
||||||
|
throw;
|
||||||
|
} catch(std::string& x) {
|
||||||
|
giveError(x);
|
||||||
|
throw;
|
||||||
|
} catch(...) {
|
||||||
|
giveError("An unknown error occurred!");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user