From de96acad9df699ff34f25e32ba616ef5c09ff124 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 31 Aug 2021 21:29:26 +0200 Subject: [PATCH] Throw an error in the template does not have default required mesurand set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- package-lock.json | 74 ++++++++++++------------- package.json | 6 +- src/charging-station/ChargingStation.ts | 4 +- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 875d43f3..4396dfe2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1844,9 +1844,9 @@ } }, "@types/node": { - "version": "14.17.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.12.tgz", - "integrity": "sha512-vhUqgjJR1qxwTWV5Ps5txuy2XMdf7Fw+OrdChRboy8BmWUPkckOhphaohzFG6b8DW7CrxaBMdrdJ47SYFq1okw==" + "version": "14.17.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.13.tgz", + "integrity": "sha512-OqG3iSnFg3cnJLsSRyhriILdDfBOwGty0fmnalbsPdYKbDgK6TI9On/36lzO/1bcaeEkg9OGD2wYLjx8t5MZNQ==" }, "@types/offscreencanvas": { "version": "2019.3.0", @@ -1948,13 +1948,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.3.tgz", - "integrity": "sha512-tBgfA3K/3TsZY46ROGvoRxQr1wBkclbVqRQep97MjVHJzcRBURRY3sNFqLk0/Xr//BY5hM9H2p/kp+6qim85SA==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz", + "integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.29.3", - "@typescript-eslint/scope-manager": "4.29.3", + "@typescript-eslint/experimental-utils": "4.30.0", + "@typescript-eslint/scope-manager": "4.30.0", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", @@ -2004,15 +2004,15 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.3.tgz", - "integrity": "sha512-ffIvbytTVWz+3keg+Sy94FG1QeOvmV9dP2YSdLFHw/ieLXWCa3U1TYu8IRCOpMv2/SPS8XqhM1+ou1YHsdzKrg==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz", + "integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==", "dev": true, "requires": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.29.3", - "@typescript-eslint/types": "4.29.3", - "@typescript-eslint/typescript-estree": "4.29.3", + "@typescript-eslint/scope-manager": "4.30.0", + "@typescript-eslint/types": "4.30.0", + "@typescript-eslint/typescript-estree": "4.30.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -2029,14 +2029,14 @@ } }, "@typescript-eslint/parser": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.3.tgz", - "integrity": "sha512-jrHOV5g2u8ROghmspKoW7pN8T/qUzk0+DITun0MELptvngtMrwUJ1tv5zMI04CYVEUsSrN4jV7AKSv+I0y0EfQ==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz", + "integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.29.3", - "@typescript-eslint/types": "4.29.3", - "@typescript-eslint/typescript-estree": "4.29.3", + "@typescript-eslint/scope-manager": "4.30.0", + "@typescript-eslint/types": "4.30.0", + "@typescript-eslint/typescript-estree": "4.30.0", "debug": "^4.3.1" }, "dependencies": { @@ -2058,29 +2058,29 @@ } }, "@typescript-eslint/scope-manager": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.3.tgz", - "integrity": "sha512-x+w8BLXO7iWPkG5mEy9bA1iFRnk36p/goVlYobVWHyDw69YmaH9q6eA+Fgl7kYHmFvWlebUTUfhtIg4zbbl8PA==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz", + "integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==", "dev": true, "requires": { - "@typescript-eslint/types": "4.29.3", - "@typescript-eslint/visitor-keys": "4.29.3" + "@typescript-eslint/types": "4.30.0", + "@typescript-eslint/visitor-keys": "4.30.0" } }, "@typescript-eslint/types": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.3.tgz", - "integrity": "sha512-s1eV1lKNgoIYLAl1JUba8NhULmf+jOmmeFO1G5MN/RBCyyzg4TIOfIOICVNC06lor+Xmy4FypIIhFiJXOknhIg==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz", + "integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.3.tgz", - "integrity": "sha512-45oQJA0bxna4O5TMwz55/TpgjX1YrAPOI/rb6kPgmdnemRZx/dB0rsx+Ku8jpDvqTxcE1C/qEbVHbS3h0hflag==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz", + "integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.29.3", - "@typescript-eslint/visitor-keys": "4.29.3", + "@typescript-eslint/types": "4.30.0", + "@typescript-eslint/visitor-keys": "4.30.0", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -2150,12 +2150,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.3.tgz", - "integrity": "sha512-MGGfJvXT4asUTeVs0Q2m+sY63UsfnA+C/FDgBKV3itLBmM9H0u+URcneePtkd0at1YELmZK6HSolCqM4Fzs6yA==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz", + "integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.29.3", + "@typescript-eslint/types": "4.30.0", "eslint-visitor-keys": "^2.0.0" } }, diff --git a/package.json b/package.json index 800ea21e..f79b0613 100644 --- a/package.json +++ b/package.json @@ -88,12 +88,12 @@ "@rollup/plugin-json": "^4.1.0", "@types/mocha": "^9.0.0", "@types/mochawesome": "^6.2.1", - "@types/node": "^14.17.12", + "@types/node": "^14.17.13", "@types/tar": "^4.0.5", "@types/uuid": "^8.3.1", "@types/ws": "^7.4.7", - "@typescript-eslint/eslint-plugin": "^4.29.3", - "@typescript-eslint/parser": "^4.29.3", + "@typescript-eslint/eslint-plugin": "^4.30.0", + "@typescript-eslint/parser": "^4.30.0", "auto-changelog": "^2.3.0", "clinic": "^9.0.0", "cross-env": "^7.0.3", diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 1626a9b3..ff0326d5 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -243,7 +243,9 @@ export default class ChargingStation { } } if (measurand === MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER) { - logger.error(`${this.logPrefix()} Missing MeterValues for default measurand ${measurand} in template on connectorId ${connectorId}`); + const errorMsg = `${this.logPrefix()} Missing MeterValues for default measurand ${measurand} in template on connectorId ${connectorId}`; + logger.error(errorMsg); + throw new Error(errorMsg); } logger.debug(`${this.logPrefix()} No MeterValues for measurand ${measurand} ${phase ? `on phase ${phase} ` : ''}in template on connectorId ${connectorId}`); } -- 2.34.1