Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Added error handling in case if reading tsconfig fails #598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ export function readConfigFile(
}

let jsonConfigFile = tsImpl.readConfigFile(configFilePath, tsImpl.sys.readFile)
if (jsonConfigFile.error) {
console.error('Error occurred while reading tsconfig file', configFilePath, jsonConfigFile)
throw new Error(
_.get(jsonConfigFile, 'error.messageText.messageText') ||
_.get(jsonConfigFile, 'error.messageText')
)
}
let compilerConfig = tsImpl.parseJsonConfigFileContent(
jsonConfigFile.config,
tsImpl.sys,
Expand Down