mirror of https://github.com/status-im/metro.git
Improve error reporting for SHA-1 retrieval
Reviewed By: rafeca Differential Revision: D7642401 fbshipit-source-id: b04610abcfbb33629db640c7d97083722db1fe17
This commit is contained in:
parent
c56e414560
commit
c67b6317fa
|
@ -237,7 +237,13 @@ class DependencyGraph extends EventEmitter {
|
||||||
|
|
||||||
getSha1(filename: string): string {
|
getSha1(filename: string): string {
|
||||||
// $FlowFixMe: TODO T27501330: Use getSha1 from HasteFS.
|
// $FlowFixMe: TODO T27501330: Use getSha1 from HasteFS.
|
||||||
const sha1 = this._hasteFS._files[filename][4];
|
const file = this._hasteFS._files[filename];
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
throw new ReferenceError(`File ${filename} is not tracked by haste-map`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const sha1 = file[4];
|
||||||
|
|
||||||
if (!sha1) {
|
if (!sha1) {
|
||||||
throw new ReferenceError(`SHA-1 for file ${filename} is not computed`);
|
throw new ReferenceError(`SHA-1 for file ${filename} is not computed`);
|
||||||
|
|
Loading…
Reference in New Issue