Skip to content

Commit cc4de7a

Browse files
zertoshfacebook-github-bot
authored andcommitted
Reject local-cli promises with Error objects
Reviewed By: davidaurelio Differential Revision: D5581520 fbshipit-source-id: 4929906ac79271c17e65fbdf5ba635f06efefd76
1 parent b65fd09 commit cc4de7a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

local-cli/dependencies/dependencies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {ASSET_REGISTRY_PATH} = require('../core/Constants');
1919
function dependencies(argv, config, args, packagerInstance) {
2020
const rootModuleAbsolutePath = args.entryFile;
2121
if (!fs.existsSync(rootModuleAbsolutePath)) {
22-
return Promise.reject(`File ${rootModuleAbsolutePath} does not exist`);
22+
return Promise.reject(new Error(`File ${rootModuleAbsolutePath} does not exist`));
2323
}
2424

2525
const transformModulePath =

local-cli/library/library.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function library(argv, config, args) {
3535
}
3636

3737
if (fs.existsSync(libraryDest)) {
38-
return Promise.reject(`Library already exists in ${libraryDest}`);
38+
return Promise.reject(new Error(`Library already exists in ${libraryDest}`));
3939
}
4040

4141
walk(source).forEach(f => {

0 commit comments

Comments
 (0)