mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 08:32:16 +01:00
Simplified error handling
This commit is contained in:
@@ -382,33 +382,24 @@ public class Helper {
|
||||
}
|
||||
|
||||
static String formatThrowable(Throwable ex) {
|
||||
return formatThrowable(ex, false, " ");
|
||||
return formatThrowable(ex, " ");
|
||||
}
|
||||
|
||||
static String formatThrowable(Throwable ex, boolean sanitize) {
|
||||
return formatThrowable(ex, sanitize, " ");
|
||||
}
|
||||
static String formatThrowable(Throwable ex, String separator) {
|
||||
if (ex instanceof MessageRemovedException)
|
||||
return null;
|
||||
|
||||
static String formatThrowable(Throwable ex, boolean sanitize, String separator) {
|
||||
if (sanitize) {
|
||||
if (ex instanceof MessageRemovedException)
|
||||
return null;
|
||||
if (ex instanceof IOException &&
|
||||
ex.getCause() instanceof MessageRemovedException)
|
||||
return null;
|
||||
|
||||
if (ex instanceof IOException &&
|
||||
ex.getCause() instanceof MessageRemovedException)
|
||||
return null;
|
||||
if (ex instanceof FolderClosedException)
|
||||
return null;
|
||||
|
||||
if (ex instanceof FolderClosedException)
|
||||
return null;
|
||||
|
||||
if (ex instanceof IllegalStateException &&
|
||||
("Not connected".equals(ex.getMessage()) ||
|
||||
"This operation is not allowed on a closed folder".equals(ex.getMessage())))
|
||||
return null;
|
||||
|
||||
//if (ex instanceof MailConnectException && ex.getCause() instanceof UnknownHostException)
|
||||
// return null;
|
||||
}
|
||||
if (ex instanceof IllegalStateException &&
|
||||
("Not connected".equals(ex.getMessage()) ||
|
||||
"This operation is not allowed on a closed folder".equals(ex.getMessage())))
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (BuildConfig.DEBUG)
|
||||
|
||||
Reference in New Issue
Block a user