Skip to content

Commit 53b59cf

Browse files
committed
Remove try/catch block around Cli.execute command
Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent f9d0e26 commit 53b59cf

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/odo.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -749,24 +749,14 @@ export class OdoImpl implements Odo {
749749
const commandPrivacy = `${command.privacyMode(true)}`;
750750
const [cmd] = commandActual.split(' ');
751751
const toolLocation = await ToolsConfig.detect(cmd);
752-
let result: cliInstance.CliExitData;
753-
try {
754-
result = await OdoImpl.cli.execute(
755-
toolLocation ? commandActual.replace(cmd, `"${toolLocation}"`) : commandActual,
756-
cwd ? {cwd} : { }
757-
);
758-
} catch (ex) {
759-
if (fail) {
760-
throw new VsCommandError(`${ex}`, `Error when running command: ${commandPrivacy}`, ex);
761-
} else {
762-
return {error: null, stdout: '', stderr: ''};
763-
}
764-
};
752+
const result: cliInstance.CliExitData = await OdoImpl.cli.execute(
753+
toolLocation ? commandActual.replace(cmd, `"${toolLocation}"`) : commandActual,
754+
cwd ? {cwd} : { }
755+
);
765756
if (result.error && fail) {
766757
throw new VsCommandError(`${result.error}`, `Error when running command: ${commandPrivacy}`, result.error);
767758
};
768759
return result;
769-
770760
}
771761

772762
public async spawn(command: string, cwd?: string): Promise<ChildProcess> {

0 commit comments

Comments
 (0)