mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-06 12:54:11 +01:00
Handle IO exceptions with underlying messaging exception
This commit is contained in:
@@ -575,6 +575,11 @@ public class MessageHelper {
|
||||
for (int i = 0; i < multipart.getCount(); i++)
|
||||
result.addAll(getAttachments(multipart.getBodyPart(i)));
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
if (ex.getCause() instanceof MessagingException)
|
||||
Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
|
||||
else
|
||||
throw ex;
|
||||
} catch (ParseException ex) {
|
||||
Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
|
||||
}
|
||||
|
||||
@@ -1003,7 +1003,12 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
} catch (FolderClosedException ex) {
|
||||
throw ex;
|
||||
} catch (IOException ex) {
|
||||
throw ex;
|
||||
if (ex.getCause() instanceof MessagingException) {
|
||||
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
if (!(ex.getCause() instanceof MessageRemovedException))
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
} else
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
@@ -1084,7 +1089,12 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
} catch (FolderClosedException ex) {
|
||||
throw ex;
|
||||
} catch (IOException ex) {
|
||||
throw ex;
|
||||
if (ex.getCause() instanceof MessagingException) {
|
||||
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
if (!(ex.getCause() instanceof MessageRemovedException))
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
} else
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
@@ -2095,7 +2105,12 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
} catch (FolderClosedException ex) {
|
||||
throw ex;
|
||||
} catch (IOException ex) {
|
||||
throw ex;
|
||||
if (ex.getCause() instanceof MessagingException) {
|
||||
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
if (!(ex.getCause() instanceof MessageRemovedException))
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
} else
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
|
||||
@@ -218,13 +218,18 @@ public class ViewModelBrowse extends ViewModel {
|
||||
}
|
||||
db.message().setMessageFound(message.account, message.thread);
|
||||
} catch (MessageRemovedException ex) {
|
||||
Log.w(Helper.TAG, folder.name + "Boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
Log.w(Helper.TAG, folder.name + " boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
} catch (FolderClosedException ex) {
|
||||
throw ex;
|
||||
} catch (IOException ex) {
|
||||
throw ex;
|
||||
if (ex.getCause() instanceof MessagingException) {
|
||||
Log.w(Helper.TAG, folder.name + " boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
if (!(ex.getCause() instanceof MessageRemovedException))
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
} else
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(Helper.TAG, folder.name + "Boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
Log.e(Helper.TAG, folder.name + " boundary " + ex + "\n" + Log.getStackTraceString(ex));
|
||||
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
|
||||
} finally {
|
||||
((IMAPMessage) isub[j]).invalidateHeaders();
|
||||
|
||||
Reference in New Issue
Block a user