From 3780ec4372c1c4de8d5ce3d374b04c2758c2a552 Mon Sep 17 00:00:00 2001 From: Ilia Babanov Date: Thu, 21 Mar 2024 12:06:31 +0100 Subject: [PATCH] Ignore stderr for validate and summary commands (#1151) We still log stderr, but don't pass it down to the callers, as it will mess up json parsing. If the command fails with non zero status we also fail, but the presence of stderr is not an indicator of failure in this case. --- packages/databricks-vscode/src/cli/CliWrapper.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/databricks-vscode/src/cli/CliWrapper.ts b/packages/databricks-vscode/src/cli/CliWrapper.ts index be75fb46a..53ea16f21 100644 --- a/packages/databricks-vscode/src/cli/CliWrapper.ts +++ b/packages/databricks-vscode/src/cli/CliWrapper.ts @@ -288,13 +288,11 @@ export class CliWrapper { }, shell: true, }); - const output = stdout + stderr; - logger?.info("Finished reading local bundle configuration.", { bundleOpName: "validate", }); - logger?.debug(output); - return output; + logger?.debug(stdout + stderr); + return stdout; } catch (e: any) { logger?.error( `Failed to read local bundle configuration. ${e.message ?? ""}`, @@ -335,13 +333,11 @@ export class CliWrapper { }, shell: true, }); - - const output = stdout + stderr; logger?.info("Bundle configuration refreshed.", { bundleOpName: "summarize", }); - logger?.debug(output); - return output; + logger?.debug(stdout + stderr); + return stdout; } catch (e: any) { logger?.error( `Failed to refresh bundle configuration. ${e.message ?? ""}`,