Sanitize read/write errors

This commit is contained in:
M66B 2019-07-29 12:18:34 +02:00
parent 78e9ed5dd9
commit deab3432b5
1 changed files with 8 additions and 0 deletions

View File

@ -99,6 +99,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.mail.FolderClosedException;
import javax.mail.MessageRemovedException;
import javax.mail.MessagingException;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;
@ -426,6 +427,13 @@ public class Helper {
if (ex instanceof MessageRemovedException)
return null;
if (ex instanceof MessagingException &&
ex.getCause() instanceof ConnectionException &&
ex.getCause().getMessage() != null &&
(ex.getCause().getMessage().contains("Read error") ||
ex.getCause().getMessage().contains("Write error")))
return null;
if (ex instanceof IOException &&
ex.getCause() instanceof MessageRemovedException)
return null;