Simplified logging logic

Throwing an exception just to log its message makes no sense...
This commit is contained in:
Dan Lew 2015-12-18 06:47:15 -06:00
parent 84cb69d170
commit 8b017acec9

View file

@ -190,16 +190,12 @@ public class MainActivity extends AppCompatActivity implements HabitRPGUserCallb
boolean ans = editor.putString(getString(R.string.SP_username), user.getAuthentication().getLocalAuthentication().getUsername())
.putString(getString(R.string.SP_email), user.getAuthentication().getLocalAuthentication().getEmail())
.commit();
try {
if (!ans) {
throw new Exception("Shared Preferences Username and Email error");
}
} catch (Exception e) {
Log.e("SHARED PREFERENCES", e.getMessage());
if (!ans) {
Log.e("SHARED PREFERENCES", "Shared Preferences Username and Email error");
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return true;