Skip to content

Commit

Permalink
Display error if configs are invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis531 committed Oct 14, 2024
1 parent ef64806 commit 7307ac0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand All @@ -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.`
);
}
}
Expand Down

0 comments on commit 7307ac0

Please sign in to comment.