Skip to content

Commit

Permalink
Catch exceptions in BaseCommandProcessor (#295)
Browse files Browse the repository at this point in the history
Otherwise the StreamCommandProcessor stops at the unhandled exception and
doesn't accept new commands.
  • Loading branch information
Chri-s authored Aug 30, 2022
1 parent db8e291 commit b042329
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ScheduledExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;


public abstract class BaseCommandProcessor implements CommandProcessor, Component, HasSchedule {
Expand Down Expand Up @@ -89,7 +91,11 @@ public void schedule(ScheduledExecutorService executor) throws OpenAS2Exception
@Override
public Void call() throws Exception {
while (running) {
processCommand();
try {
processCommand();
} catch (Exception ex) {
Logger.getLogger(BaseCommandProcessor.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
}
}
return VOID;
}
Expand Down

0 comments on commit b042329

Please sign in to comment.