From ca789ba9dd3a11af8204370c5289164051eea410 Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Sun, 18 Nov 2018 21:34:07 -0800 Subject: [PATCH 1/2] Throw an error if creating a Folder fails. --- src/TileSource.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TileSource.js b/src/TileSource.js index 47a3805..9430489 100644 --- a/src/TileSource.js +++ b/src/TileSource.js @@ -169,6 +169,7 @@ class TileSource { return true; } catch (error) { return error.code === 'EEXIST'; + throw error; } } } From 66a605254c0100f7653f7935fa381ee247207b59 Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Sun, 24 Mar 2019 17:59:46 -0700 Subject: [PATCH 2/2] Fix mistake where _createFolder wouldn't throw an error --- src/TileSource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TileSource.js b/src/TileSource.js index 9430489..1b5000b 100644 --- a/src/TileSource.js +++ b/src/TileSource.js @@ -168,7 +168,7 @@ class TileSource { fs.mkdirSync(path); return true; } catch (error) { - return error.code === 'EEXIST'; + if (error.code === 'EEXIST') return true; throw error; } }