mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +00:00
Wrap JSON parse errors in parseMatrixInput with context
This commit is contained in:
@@ -894,7 +894,13 @@ export function parseMatrixInput(
|
||||
if (matrixInput === undefined || matrixInput === "null") {
|
||||
return undefined;
|
||||
}
|
||||
return JSON.parse(matrixInput) as { [key: string]: string };
|
||||
try {
|
||||
return JSON.parse(matrixInput) as { [key: string]: string };
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`Failed to parse matrix input '${matrixInput}': ${getErrorMessage(err)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function wrapError(error: unknown): Error {
|
||||
|
||||
Reference in New Issue
Block a user