Simplified search exceptions

pull/199/head
M66B 3 years ago
parent 019806b3c5
commit 2f256310cc

@ -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…
Cancel
Save