From abef60e86ab40ada333cd0d7e02151735a94b26b Mon Sep 17 00:00:00 2001 From: skutner Date: Thu, 15 Dec 2022 15:33:19 +0200 Subject: [PATCH] Pharmaledger-IMI/epi-workspace#1059 return from BrickMap.delete method if the record does not exist --- lib/BrickMapMixin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/BrickMapMixin.js b/lib/BrickMapMixin.js index 4ef2dcd..fb11ee2 100644 --- a/lib/BrickMapMixin.js +++ b/lib/BrickMapMixin.js @@ -370,10 +370,10 @@ const BrickMapMixin = { barPath = pskPath.normalize(barPath); const childNode = this.getDeepestNode(barPath); if (!childNode) { - throw new Error(`Unable to delete <${barPath}>. File or directory not found.`); + return; } if (this.nodeIsDeleted(childNode)) { - throw new Error(`Unable to delete <${barPath}>. File or directory already deleted.`); + return; } this.deleteNode(childNode);