Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP4j logs errors instead of delegating exception handling to the caller #849

Open
bastiandoetsch opened this issue Sep 13, 2024 · 0 comments

Comments

@bastiandoetsch
Copy link

In org.eclipse.lsp4j.jsonrpc.RemoteEndpoint#notify failures are logged instead of throwing the exception. This means, users cannot ignore this log/error condition when e.g. shutting down. Is there a chance to change this behaviour, to not log and instead throw the exception?

@Override
	public void notify(String method, Object parameter) {
		NotificationMessage notificationMessage = createNotificationMessage(method, parameter);
		try {
			out.consume(notificationMessage);
		} catch (Exception exception) {
			Level logLevel = JsonRpcException.indicatesStreamClosed(exception) ? Level.INFO : Level.WARNING;
			LOG.log(logLevel, "Failed to send notification message.", exception);
		}
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant