Skip to content

Commit

Permalink
We shouldn't be checking the error message for sqlite constraint exce…
Browse files Browse the repository at this point in the history
…ptions--different phones do it differently
  • Loading branch information
sbosley committed Sep 8, 2012
1 parent d5b3d2a commit b03eda4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions astrid/src/com/todoroo/astrid/dao/TaskDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteConstraintException;
import android.util.Log;

import com.timsu.astrid.R;
import com.todoroo.andlib.data.DatabaseDao;
Expand Down Expand Up @@ -189,10 +188,7 @@ public boolean save(Task task) {
try {
saveSuccessful = createNew(task);
} catch (SQLiteConstraintException e) {
if(e.getMessage().contains(Task.REMOTE_ID_PROPERTY_NAME)) {
// Tried to create task with remote id that already exists
saveSuccessful = handleSQLiteConstraintException(task);
}
saveSuccessful = handleSQLiteConstraintException(task); // Tried to create task with remote id that already exists
}
} else {
saveSuccessful = saveExisting(task);
Expand Down

0 comments on commit b03eda4

Please sign in to comment.