Skip to content

readFile may return undefined#17210

Merged
sheetalkamat merged 2 commits intomasterfrom
readfile
Jul 17, 2017
Merged

readFile may return undefined#17210
sheetalkamat merged 2 commits intomasterfrom
readfile

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jul 14, 2017

Fixes #17138

@ghost ghost requested a review from sheetalkamat July 14, 2017 21:34
@ghost ghost force-pushed the readfile branch from d763060 to 5b52b06 Compare July 14, 2017 22:48
@ghost ghost force-pushed the readfile branch from 5b52b06 to 96d537b Compare July 14, 2017 22:57
Comment thread src/compiler/commandLineParser.ts Outdated
return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);
}
return parseJsonText(fileName, text);
return text === undefined ? createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, "File does not exist.") : text;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String "File does not exist " needs to be in diagnostic messages json instead of hard coding it here.

@sheetalkamat sheetalkamat merged commit 54dfdd7 into master Jul 17, 2017
@ghost ghost deleted the readfile branch July 17, 2017 21:45
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants