Permalink
Browse files

packager: Package.js: cover the error cases

Summary: In case the sync function throws, it wouldn't be handled through the promise anymore, that is not what we want. So we revert that in this changeset.

Reviewed By: davidaurelio

Differential Revision: D4754740

fbshipit-source-id: 4da360f4b629bbdf9cd284389060429cc9259c2c
  • Loading branch information...
jeanlauliac authored and facebook-github-bot committed Mar 22, 2017
1 parent 379b60d commit 909d2e5503db90283a7a849a4fb2408f311a1ecb
Showing with 2 additions and 2 deletions.
  1. +2 −2 packager/src/node-haste/Package.js
@@ -67,13 +67,13 @@ class Package {
isHaste() {
return this._cache.get(this.path, 'package-haste', () =>
Promise.resolve(!!this.read().name)
Promise.resolve().then(() => !!this.read().name)
);
}
getName(): Promise<string> {
return this._cache.get(this.path, 'package-name', () =>
Promise.resolve(this.read().name)
Promise.resolve().then(() => this.read().name)
);
}

0 comments on commit 909d2e5

Please sign in to comment.