[Packager] Fix when loading a path that can't be handled

Summary:
[Packager] Adds `NotFoundError` when loading a path that can't be handled

Resolves https://github.com/facebook/react-native/issues/1944
Closes https://github.com/facebook/react-native/pull/1948
Github Author: Dave Sibiski <dsibiski@gmail.com>
This commit is contained in:
Dave Sibiski 2015-07-15 08:24:01 -07:00
parent 915540d237
commit 70feab9d50
1 changed files with 10 additions and 1 deletions

View File

@ -150,7 +150,16 @@ class DependencyGraph {
getOrderedDependencies(entryPath) {
return this.load().then(() => {
const absolutePath = path.resolve(this._getAbsolutePath(entryPath));
const absPath = this._getAbsolutePath(entryPath);
if (absPath == null) {
throw new NotFoundError(
'Could not find source file at %s',
entryPath
);
}
const absolutePath = path.resolve(absPath);
if (absolutePath == null) {
throw new NotFoundError(