Skip to content

Commit

Permalink
Catch promise
Browse files Browse the repository at this point in the history
  • Loading branch information
tzyl committed Dec 12, 2024
1 parent 780ad87 commit f9c8064
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/cli/src/util/configLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ let configPromise: Promise<LoadedFoundryConfig | undefined> | undefined =

function getConfig(): Promise<LoadedFoundryConfig | undefined> {
if (configPromise == null) {
try {
configPromise = loadFoundryConfig();
} catch (e) {
configPromise = loadFoundryConfig().catch((e) => {
throw new ExitProcessError(2, e instanceof Error ? e.message : undefined);
}
});
}
return configPromise;
}
Expand Down

0 comments on commit f9c8064

Please sign in to comment.