mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +00:00
Improved op error handling
This commit is contained in:
parent
33dcbb4039
commit
2f5cb0ec62
1 changed files with 17 additions and 16 deletions
|
@ -437,13 +437,28 @@ class Core {
|
|||
ops.remove(s);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(folder.name, ex);
|
||||
db.operation().setOperationTries(op.id, op.tries);
|
||||
|
||||
EntityLog.log(context, folder.name +
|
||||
" op=" + op.name +
|
||||
" try=" + op.tries +
|
||||
" " + Log.formatThrowable(ex, false));
|
||||
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
db.operation().setOperationTries(op.id, op.tries);
|
||||
|
||||
op.error = Log.formatThrowable(ex);
|
||||
db.operation().setOperationError(op.id, op.error);
|
||||
|
||||
if (message != null &&
|
||||
!(ex instanceof IllegalArgumentException))
|
||||
db.message().setMessageError(message.id, op.error);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
if (similar.size() > 0) {
|
||||
// Retry individually
|
||||
group = false;
|
||||
|
@ -451,20 +466,6 @@ class Core {
|
|||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
op.error = Log.formatThrowable(ex, false);
|
||||
db.operation().setOperationError(op.id, Log.formatThrowable(ex));
|
||||
|
||||
if (message != null && !(ex instanceof IllegalArgumentException))
|
||||
db.message().setMessageError(message.id, Log.formatThrowable(ex));
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
if (ifolder != null && !ifolder.isOpen())
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue