Improved send error handling

pull/153/head
M66B 6 years ago
parent a925185bb2
commit 6f8c00c690

@ -210,7 +210,6 @@ class Core {
// Operation succeeded // Operation succeeded
db.operation().deleteOperation(op.id); db.operation().deleteOperation(op.id);
} catch (Throwable ex) { } catch (Throwable ex) {
// TODO: SMTP response codes: https://www.ietf.org/rfc/rfc821.txt
Log.e(folder.name, ex); Log.e(folder.name, ex);
reportError(context, account, folder, ex); reportError(context, account, folder, ex);

@ -194,16 +194,20 @@ public class ServiceSend extends LifecycleService {
db.operation().deleteOperation(op.id); db.operation().deleteOperation(op.id);
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(outbox.name, ex);
Core.reportError(ServiceSend.this, null, outbox, ex);
db.operation().setOperationError(op.id, Helper.formatThrowable(ex));
if (message != null) if (message != null)
db.message().setMessageError(message.id, Helper.formatThrowable(ex)); db.message().setMessageError(message.id, Helper.formatThrowable(ex));
if (ex instanceof MessageRemovedException || if (ex instanceof MessageRemovedException ||
ex instanceof SendFailedException || ex instanceof SendFailedException ||
ex instanceof IllegalArgumentException) ex instanceof IllegalArgumentException) {
Log.w("Unrecoverable");
db.operation().deleteOperation(op.id); db.operation().deleteOperation(op.id);
else continue;
} else
throw ex; throw ex;
} finally { } finally {
Log.i(outbox.name + " end op=" + op.id + "/" + op.name); Log.i(outbox.name + " end op=" + op.id + "/" + op.name);

Loading…
Cancel
Save