Skip to content

Commit bb89d8d

Browse files
Ensure we don't send strings in the error property
1 parent 9f025aa commit bb89d8d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

packages/openops/src/lib/cloud-cli-common.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ export function handleCliError({
1010
command: string;
1111
error: unknown;
1212
}): never {
13-
logger.error(`${provider} CLI execution failed.`, {
14-
command,
15-
error,
16-
});
13+
logger.error(
14+
`${provider} CLI execution failed.`,
15+
error instanceof Error
16+
? { command, error }
17+
: { command, errorMessage: error },
18+
);
1719

1820
const message = `An error occurred while running ${provider} CLI command: ${error}`;
1921

0 commit comments

Comments
 (0)