mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 11:01:23 +01:00
Hide FolderClosedIOException
This commit is contained in:
@@ -23,6 +23,8 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import com.sun.mail.util.FolderClosedIOException;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -724,7 +726,7 @@ public class MessageHelper {
|
||||
private List<AttachmentPart> attachments = new ArrayList<>();
|
||||
private ArrayList<String> warnings = new ArrayList<>();
|
||||
|
||||
String getHtml(Context context) throws MessagingException, IOException {
|
||||
String getHtml(Context context) throws MessagingException {
|
||||
if (plain == null && html == null) {
|
||||
warnings.add(context.getString(R.string.title_no_body));
|
||||
return null;
|
||||
@@ -743,12 +745,10 @@ 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
|
||||
} catch (FolderClosedException ex) {
|
||||
throw ex;
|
||||
} catch (FolderClosedIOException ex) {
|
||||
throw new FolderClosedException(ex.getFolder(), "getHtml", ex);
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
text = true;
|
||||
@@ -876,6 +876,8 @@ public class MessageHelper {
|
||||
db.attachment().setDownloaded(id, size);
|
||||
|
||||
Log.i("Downloaded attachment size=" + size);
|
||||
} catch (FolderClosedIOException ex) {
|
||||
throw new FolderClosedException(ex.getFolder(), "downloadAttachment", ex);
|
||||
} catch (Throwable ex) {
|
||||
// Reset progress on failure
|
||||
db.attachment().setError(id, Helper.formatThrowable(ex));
|
||||
|
||||
Reference in New Issue
Block a user