Skip to content

Commit

Permalink
Additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sdedic committed Nov 15, 2022
1 parent ca1c7a7 commit 207ee93
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ private static Launcher<NbCodeLanguageClient> createLauncher(LanguageServerImpl
});
})
.setExceptionHandler((t) -> {
System.err.println("Error during dispatch at server ");
t.printStackTrace();
LOG.log(Level.WARNING, "Error occurred during LSP message dispatch", t);
return RemoteEndpoint.DEFAULT_EXCEPTION_HANDLER.apply(t);
})
.create();
Expand Down Expand Up @@ -263,14 +262,7 @@ public void consume(Message msg) throws MessageIssueException, JsonRpcException
try {
delegate.consume(msg);
} catch (RuntimeException | Error e) {
System.err.println("Error occurred during message dispatch");
e.printStackTrace();
LOG.log(Level.WARNING, "Error occurred during message dispatch", e);
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Exceptions.printStackTrace(ex);
}
throw e;
} finally {
// cancel while the OperationContext is still active.
Expand Down
Loading

0 comments on commit 207ee93

Please sign in to comment.