From dbcb71c075e46f99d0984d1c137f20127b0766ea Mon Sep 17 00:00:00 2001 From: build-token <build-token> Date: Mon, 6 Mar 2023 14:49:38 +0000 Subject: [PATCH] publish: throw new error generated from commit 52730f0f758670fe9852ad8744cc1e81048a931a --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 2e4b1c1..1faf750 100644 --- a/index.js +++ b/index.js @@ -247513,6 +247513,12 @@ async function getInseeCode(postalCode, city) { sanitizeCity(commune.nomCommune).includes(parsedCity) ) + if (filteredResponse.length > 1) { + throw new Error( + 'Input city is not precise enough, more than one city was found' + ) + } + return filteredResponse[0].codeCommune } } catch (error) { -- GitLab