From 839a2502fa47c46230d1575becaaa876f433fa7b Mon Sep 17 00:00:00 2001 From: petervanrijt Date: Thu, 22 Jul 2021 09:33:46 +0200 Subject: [PATCH] Improve error message on Autotune run without BG-data (#1404) * Better error handling for Autotune without BG-data Prevents technical error on the logging which users of Autotune(Web) see. * Improve error message on Autotune without BG-data Informs users on where to start investigation. --- bin/oref0-autotune-prep.js | 1 + bin/oref0-autotune.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/oref0-autotune-prep.js b/bin/oref0-autotune-prep.js index 2ce3082d5..3a70bb075 100755 --- a/bin/oref0-autotune-prep.js +++ b/bin/oref0-autotune-prep.js @@ -104,6 +104,7 @@ if (!module.parent) { var glucose_data = JSON.parse(fs.readFileSync(glucose_input, 'utf8')); } catch (e) { console.error("Warning: could not parse "+glucose_input); + return console.error("Warning: could not parse "+glucose_input", e); } var carb_data = { }; diff --git a/bin/oref0-autotune.sh b/bin/oref0-autotune.sh index ac3c53a36..393a87303 100755 --- a/bin/oref0-autotune.sh +++ b/bin/oref0-autotune.sh @@ -248,7 +248,7 @@ do cp profile.pump.json profile.json exit else - die "Could not run oref0-autotune-core autotune.$i.json profile.json profile.pump.json" + die "Could not run oref0-autotune-core autotune.$i.json profile.json profile.pump.json. Make sure Nightscout contains BG-values for the selected date range, Autotune(Web) does not work without BG-values. See documentation on the how-to check http://nightscout.github.io/nightscout/reports/#day-to-day ." fi else # Copy tuned profile produced by autotune to profile.json for use with next day of data