Fix: Crash if log file is missing + Crash on random interrupt

This commit is contained in:
◱ PixelyIon 2019-07-25 02:31:31 +05:30
parent 696ebde527
commit 3bdbe41c13
2 changed files with 6 additions and 6 deletions

View File

@ -27,7 +27,7 @@ namespace lightSwitch::os {
SvcHandler(svcId, state);
} else {
state.logger->write(Logger::ERROR, "An unhandled interrupt has occurred: {}", int_no);
exit(int_no);
state.cpu->StopExecution();
}
} catch (exception &e) {
state.logger->write(Logger::WARN, "An exception occurred during an interrupt: {}", e.what());

View File

@ -41,11 +41,6 @@ public class LogActivity extends AppCompatActivity {
try {
InputStream inputStream = new FileInputStream(log_file);
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() {
@Override
public void run() {
@ -82,6 +77,11 @@ public class LogActivity extends AppCompatActivity {
}
});
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