From 8fbe26c496c3a1bc9e28cff7b039c1d9c3368ea2 Mon Sep 17 00:00:00 2001 From: Jiaming <71547730+Jiaaming@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:17:30 +0800 Subject: [PATCH] docs - Add comments for grpc client handleConnectError (#1565) --- extension/src/client/TaskServerClient.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extension/src/client/TaskServerClient.ts b/extension/src/client/TaskServerClient.ts index eef2ac63c..f6a23d4ff 100644 --- a/extension/src/client/TaskServerClient.ts +++ b/extension/src/client/TaskServerClient.ts @@ -388,6 +388,13 @@ export class TaskServerClient implements vscode.Disposable { logger.info("Build cancelled:", cancelled.getMessage()); }; + /** + * This is called when there is an error connecting to the Task server which uses GRPC. + * If Task server is down, it means that the whole Gradle server is not running. + * So here if the server is not ready, we should restart the gradle server. + * If gradle server is ready, it implies that GRPC server is up but the grpc client was unable to connect. + * @param e GRPC connection error + */ private handleConnectError = async (e: Error): Promise => { logger.error("Error connecting to gradle server:", e.message); this.close();