Skip to content

Commit

Permalink
fix(errors): show stacktrace when an error reading declarations file …
Browse files Browse the repository at this point in the history
…is caught
  • Loading branch information
uladkasach committed Feb 14, 2023
1 parent 0d772e0 commit 2ea9cb7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/logic/compose/generateSchema/readDeclarationFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ export const readDeclarationFile = async ({
}: {
declarationsPath: string;
}) => {
return require(declarationsPath);
try {
return await import(declarationsPath);
} catch (error) {
console.warn(
'an error was thrown when attempting to read your declarations file',
);
console.error(error);
throw error;
}
};

0 comments on commit 2ea9cb7

Please sign in to comment.