From cc4de7abc46dbb19131888e47150f6f97368ac28 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Tue, 8 Aug 2017 09:31:55 -0700 Subject: [PATCH] Reject local-cli promises with Error objects Reviewed By: davidaurelio Differential Revision: D5581520 fbshipit-source-id: 4929906ac79271c17e65fbdf5ba635f06efefd76 --- local-cli/dependencies/dependencies.js | 2 +- local-cli/library/library.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/local-cli/dependencies/dependencies.js b/local-cli/dependencies/dependencies.js index 36034be37..f491e7f01 100644 --- a/local-cli/dependencies/dependencies.js +++ b/local-cli/dependencies/dependencies.js @@ -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 = diff --git a/local-cli/library/library.js b/local-cli/library/library.js index 6a8d36920..9dacc1134 100644 --- a/local-cli/library/library.js +++ b/local-cli/library/library.js @@ -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 => {