Skip to content

Commit

Permalink
Reject local-cli promises with Error objects
Browse files Browse the repository at this point in the history
Reviewed By: davidaurelio

Differential Revision: D5581520

fbshipit-source-id: 4929906ac79271c17e65fbdf5ba635f06efefd76
  • Loading branch information
zertosh authored and facebook-github-bot committed Aug 8, 2017
1 parent b65fd09 commit cc4de7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion local-cli/dependencies/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const {ASSET_REGISTRY_PATH} = require('../core/Constants');
function dependencies(argv, config, args, packagerInstance) {
const rootModuleAbsolutePath = args.entryFile;
if (!fs.existsSync(rootModuleAbsolutePath)) {
return Promise.reject(`File ${rootModuleAbsolutePath} does not exist`);
return Promise.reject(new Error(`File ${rootModuleAbsolutePath} does not exist`));
}

const transformModulePath =
Expand Down
2 changes: 1 addition & 1 deletion local-cli/library/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function library(argv, config, args) {
}

if (fs.existsSync(libraryDest)) {
return Promise.reject(`Library already exists in ${libraryDest}`);
return Promise.reject(new Error(`Library already exists in ${libraryDest}`));
}

walk(source).forEach(f => {
Expand Down

0 comments on commit cc4de7a

Please sign in to comment.