Skip to content

Commit ca7fbd8

Browse files
Copilotmrlubos
authored andcommitted
fix: avoid duplicating error message string using let in postprocessOutput
Agent-Logs-Url: https://github.com/hey-api/openapi-ts/sessions/f7a80408-cf1a-4b31-9fdf-1881e5f8dc6f
1 parent ebe6f93 commit ca7fbd8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/shared/src/config/output/postprocess.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ export function postprocessOutput(
6767
}
6868

6969
if (result.status !== 0) {
70+
let message = `Post-processor "${name}" exited with code ${result.status}`;
7071
const stderr = result.stderr?.toString().trim();
71-
const message = stderr
72-
? `Post-processor "${name}" exited with code ${result.status}:\n${stderr}`
73-
: `Post-processor "${name}" exited with code ${result.status}`;
72+
if (stderr) {
73+
message += `:\n${stderr}`;
74+
}
7475
throw new Error(message);
7576
}
7677
}

0 commit comments

Comments
 (0)