mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +00:00
Simplified search exceptions
This commit is contained in:
parent
019806b3c5
commit
2f256310cc
1 changed files with 65 additions and 59 deletions
|
@ -353,7 +353,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
return found;
|
||||
}
|
||||
|
||||
private int load_server(final State state) throws MessagingException, IOException {
|
||||
private int load_server(final State state) throws MessagingException, ProtocolException, IOException {
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
@ -418,7 +418,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
else
|
||||
state.imessages = state.ifolder.search(new AndTerm(and.toArray(new SearchTerm[0])));
|
||||
EntityLog.log(context, "Boundary filter messages=" + state.imessages.length);
|
||||
} else {
|
||||
} else
|
||||
try {
|
||||
Object result = state.ifolder.doCommand(new IMAPFolder.ProtocolCommand() {
|
||||
@Override
|
||||
public Object doCommand(IMAPProtocol protocol) throws ProtocolException {
|
||||
|
@ -484,6 +485,11 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
});
|
||||
|
||||
state.imessages = (Message[]) result;
|
||||
} catch (MessagingException ex) {
|
||||
if (ex.getCause() instanceof ProtocolException)
|
||||
throw (ProtocolException) ex.getCause();
|
||||
else
|
||||
throw ex;
|
||||
}
|
||||
EntityLog.log(context, "Boundary found messages=" + state.imessages.length);
|
||||
|
||||
|
|
Loading…
Reference in a new issue