Handle all exceptions when loading termux.properties (#1590)

* Catch all exceptions which can occur.
* Print short description in toast message about occurred exception.
This commit is contained in:
Leonid Pliushch
2020-06-06 21:20:05 +03:00
committed by GitHub
parent b6d7831646
commit f794bfcadc

View File

@@ -162,8 +162,8 @@ final class TermuxPreferences {
props.load(new InputStreamReader(in, StandardCharsets.UTF_8));
}
}
} catch (IOException e) {
Toast.makeText(context, "Could not open properties file termux.properties.", Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(context, "Could not open properties file termux.properties: " + e.getMessage(), Toast.LENGTH_LONG).show();
Log.e("termux", "Error loading props", e);
}