mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 09:59:43 +00:00
Display the error message on one line if possible
This commit is contained in:
6
lib/codeql.js
generated
6
lib/codeql.js
generated
@@ -41,8 +41,10 @@ class CommandInvocationError extends Error {
|
||||
const prettyCommand = [cmd, ...args]
|
||||
.map((x) => (x.includes(" ") ? `'${x}'` : x))
|
||||
.join(" ");
|
||||
super(`Encountered a fatal error while running "${prettyCommand}".\n` +
|
||||
`Exit code was ${exitCode} and error was:\n` +
|
||||
error = error.trim();
|
||||
const separator = error.includes("\n") ? "\n" : " ";
|
||||
super(`Encountered a fatal error while running "${prettyCommand}".${separator}` +
|
||||
`Exit code was ${exitCode} and error was:${separator}` +
|
||||
`${error}`);
|
||||
this.exitCode = exitCode;
|
||||
this.error = error;
|
||||
|
||||
Reference in New Issue
Block a user