We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ac59f7 commit ba8ff05Copy full SHA for ba8ff05
src/componentDetection.ts
@@ -119,7 +119,12 @@ export default class ComponentDetection {
119
public async getManifestsFromResults(file: string, path: string): Promise<Manifest[] | undefined> {
120
console.debug(`Reading results from ${file}`);
121
const results = await fs.readFileSync(file, 'utf8');
122
- const json: any = JSON.parse(results);
+ let json: any;
123
+ try {
124
+ json = JSON.parse(results);
125
+ } catch (err: any) {
126
+ throw new Error(`Failed to parse JSON results from component-detection output file "${file}": ${err instanceof Error ? err.message : String(err)}`);
127
+ }
128
129
let dependencyGraphs: DependencyGraphs = this.normalizeDependencyGraphPaths(json.dependencyGraphs, path);
130
0 commit comments