Avoid checking err.stderr when it's not necessary

This commit is contained in:
Robert
2023-09-18 16:33:54 +01:00
parent 1b0f0f4566
commit 23641a01d9
2 changed files with 3 additions and 9 deletions

View File

@@ -547,9 +547,7 @@ export class CodeQLCliServer implements Disposable {
yield JSON.parse(event) as EventType;
} catch (err) {
throw new Error(
`Parsing output of ${description} failed: ${
(err as any).stderr || getErrorMessage(err)
}`,
`Parsing output of ${description} failed: ${getErrorMessage(err)}`,
);
}
}
@@ -647,9 +645,7 @@ export class CodeQLCliServer implements Disposable {
return JSON.parse(result) as OutputType;
} catch (err) {
throw new Error(
`Parsing output of ${description} failed: ${
(err as any).stderr || getErrorMessage(err)
}`,
`Parsing output of ${description} failed: ${getErrorMessage(err)}`,
);
}
}

View File

@@ -54,9 +54,7 @@ export async function sarifParser(
});
} catch (e) {
throw new Error(
`Parsing output of interpretation failed: ${
(e as any).stderr || getErrorMessage(e)
}`,
`Parsing output of interpretation failed: ${getErrorMessage(e)}`,
);
}
}