From 183df528f1ba708dfd5825995537f3f089ab63ba Mon Sep 17 00:00:00 2001 From: rick Date: Wed, 24 Mar 2021 21:33:49 +0100 Subject: [PATCH] Lecture du fichier dans try --- jour12/jour12.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jour12/jour12.js b/jour12/jour12.js index be8c429..d1b56f6 100644 --- a/jour12/jour12.js +++ b/jour12/jour12.js @@ -1,8 +1,8 @@ const fs = require('fs'); -const file = fs.readFileSync("input", "utf8"); -const data = JSON.parse(file); try { + const file = fs.readFileSync("input", "utf8"); + const data = JSON.parse(file); console.log("Traitement de la première partie…"); console.log("La somme totale est " + parseJsonPrem(data)); } catch(err) {