Catch transient message exceptions

This commit is contained in:
M66B
2019-04-25 16:11:32 +02:00
parent fdf2cb812b
commit 89802363f1

View File

@@ -724,7 +724,7 @@ public class MessageHelper {
private List<AttachmentPart> attachments = new ArrayList<>();
private ArrayList<String> warnings = new ArrayList<>();
String getHtml(Context context) throws MessagingException {
String getHtml(Context context) throws MessagingException, IOException {
if (plain == null && html == null) {
warnings.add(context.getString(R.string.title_no_body));
return null;
@@ -743,6 +743,12 @@ public class MessageHelper {
result = readStream((InputStream) content, "UTF-8");
else
result = content.toString();
} catch (MessagingException ex) {
// Including FolderClosedException
throw ex;
} catch (IOException ex) {
// Including FolderClosedIOException
throw ex;
} catch (Throwable ex) {
Log.w(ex);
text = true;