Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display error if configs are invalid #1193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading