Skip to content

Commit

Permalink
utils: add error-handling for JSON parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
leventebalogh committed Nov 14, 2024
1 parent 111a0d3 commit 45d3ff8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/create-plugin/src/utils/utils.goSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ function getLatestSdkVersion(exportPath: string): Promise<string> {
debug(error);
reject();
}
const version = JSON.parse(stdout).Version;
resolve(version);

try {
const version = JSON.parse(stdout).Version;
resolve(version);
} catch (e) {
debug(e);
reject();
}
});
});
}

0 comments on commit 45d3ff8

Please sign in to comment.