@@ -140,7 +140,7 @@ int main(int argc, char** argv) {
140
140
machine_str = MachineFactory::machine_name_from_rom (bootrom_path);
141
141
if (machine_str.empty ()) {
142
142
LOG_F (ERROR, " Could not autodetect machine" );
143
- return 0 ;
143
+ return 1 ;
144
144
}
145
145
else {
146
146
LOG_F (INFO, " Machine was autodetected as: %s" , machine_str.c_str ());
@@ -150,7 +150,7 @@ int main(int argc, char** argv) {
150
150
/* handle overriding of machine settings from command line */
151
151
map<string, string> settings;
152
152
if (MachineFactory::get_machine_settings (machine_str, settings) < 0 ) {
153
- return 0 ;
153
+ return 1 ;
154
154
}
155
155
156
156
CLI::App sa;
@@ -168,7 +168,7 @@ int main(int argc, char** argv) {
168
168
169
169
if (SDL_Init (SDL_INIT_VIDEO)) {
170
170
LOG_F (ERROR, " SDL_Init error: %s" , SDL_GetError ());
171
- return 0 ;
171
+ return 1 ;
172
172
}
173
173
174
174
// initialize global profiler object
@@ -180,6 +180,9 @@ int main(int argc, char** argv) {
180
180
181
181
// graceful handling of fatal errors
182
182
loguru::set_fatal_handler ([](const loguru::Message& message) {
183
+ // Make sure the reason for the failure is visible (it may have been
184
+ // sent to the logfile only).
185
+ cerr << message.preamble << message.indentation << message.prefix << message.message << endl;
183
186
enter_debugger ();
184
187
185
188
abort ();
@@ -206,7 +209,7 @@ int main(int argc, char** argv) {
206
209
break ;
207
210
default :
208
211
LOG_F (ERROR, " Invalid EXECUTION MODE" );
209
- return 0 ;
212
+ return 1 ;
210
213
}
211
214
212
215
bail:
0 commit comments