From cfb8516925960b11972c4c5d6298a05184db7f9f Mon Sep 17 00:00:00 2001 From: Miguel Jimenez Esun Date: Thu, 1 Mar 2018 05:30:35 -0800 Subject: [PATCH] Only capture "ENOENT"s in "FileStore" Reviewed By: jeanlauliac Differential Revision: D7111352 fbshipit-source-id: 97525051e58482d7f0604cd9c3e50183db83d455 --- packages/metro-cache/src/FileStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/metro-cache/src/FileStore.js b/packages/metro-cache/src/FileStore.js index 85842bc5..6106807c 100644 --- a/packages/metro-cache/src/FileStore.js +++ b/packages/metro-cache/src/FileStore.js @@ -38,7 +38,11 @@ class FileStore { try { return serializer.readFileSync(this._getFilePath(key)); } catch (err) { - return null; + if (err.code === 'ENOENT') { + return null; + } + + throw err; } }