Skip to content

Commit

Permalink
fix: misleading error message
Browse files Browse the repository at this point in the history
If `tsconfig.json` cannot be parsed, don't say it's not found.
  • Loading branch information
alexander-fenster authored May 6, 2020
1 parent bb34f86 commit d94a240
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ async function getBase(
readFiles.add(filePath);
try {
const json = await customReadFilep(filePath, 'utf8');
} catch (err) {
throw new Error(`${filePath} not found`);
}
try {
let contents = JSON.parse(json);

if (contents.extends) {
Expand All @@ -91,7 +95,7 @@ async function getBase(

return contents;
} catch (err) {
throw new Error(`${filePath} Not Found`);
throw new Error(`${filePath} cannot be parsed`);
}
}

Expand Down

0 comments on commit d94a240

Please sign in to comment.