From 7307ac04c88e5bf3b59b550d5a80aa5d6281ec74 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Mon, 14 Oct 2024 15:04:30 +0200 Subject: [PATCH] Display error if configs are invalid --- src/settings.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/settings.tsx b/src/settings.tsx index c7942d9a..c48dde68 100644 --- a/src/settings.tsx +++ b/src/settings.tsx @@ -380,11 +380,10 @@ const validate = ( const newValue = validation(value, allowParse, src); return newValue === undefined ? value : newValue; } catch (e) { - console.warn( + throw new Error( `Validation of setting '${path}' (${sourceDescription}) with value '${value}' failed: ` - + `${e}. Ignoring.` + + `${e}.` ); - return null; } }; @@ -405,8 +404,8 @@ const validate = ( out[key] = validatedValue; } } else { - console.warn( - `'${newPath}' (${sourceDescription}) is not a valid settings key. Ignoring.` + throw new Error( + `'${newPath}' (${sourceDescription}) is not a valid settings key.` ); } }