Skip to content

Commit

Permalink
Ignore stderr for validate and summary commands (#1151)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ilia-db authored Mar 21, 2024
1 parent 2cff68e commit 3780ec4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/databricks-vscode/src/cli/CliWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? ""}`,
Expand Down Expand Up @@ -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 ?? ""}`,
Expand Down

0 comments on commit 3780ec4

Please sign in to comment.