mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-10 13:29:25 +01:00
Fix: Crash if log file is missing + Crash on random interrupt
This commit is contained in:
parent
696ebde527
commit
3bdbe41c13
@ -27,7 +27,7 @@ namespace lightSwitch::os {
|
|||||||
SvcHandler(svcId, state);
|
SvcHandler(svcId, state);
|
||||||
} else {
|
} else {
|
||||||
state.logger->write(Logger::ERROR, "An unhandled interrupt has occurred: {}", int_no);
|
state.logger->write(Logger::ERROR, "An unhandled interrupt has occurred: {}", int_no);
|
||||||
exit(int_no);
|
state.cpu->StopExecution();
|
||||||
}
|
}
|
||||||
} catch (exception &e) {
|
} catch (exception &e) {
|
||||||
state.logger->write(Logger::WARN, "An exception occurred during an interrupt: {}", e.what());
|
state.logger->write(Logger::WARN, "An exception occurred during an interrupt: {}", e.what());
|
||||||
|
@ -41,11 +41,6 @@ public class LogActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
InputStream inputStream = new FileInputStream(log_file);
|
InputStream inputStream = new FileInputStream(log_file);
|
||||||
reader = new BufferedReader(new InputStreamReader(inputStream));
|
reader = new BufferedReader(new InputStreamReader(inputStream));
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
Log.w("Logger", "IO Error during access of log file: " + e.getMessage());
|
|
||||||
Toast.makeText(getApplicationContext(), getString(R.string.file_missing), Toast.LENGTH_LONG).show();
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
thread = new Thread(new Runnable() {
|
thread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -82,6 +77,11 @@ public class LogActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
thread.start();
|
thread.start();
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.w("Logger", "IO Error during access of log file: " + e.getMessage());
|
||||||
|
Toast.makeText(getApplicationContext(), getString(R.string.file_missing), Toast.LENGTH_LONG).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user