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

Check program input #23

Merged
merged 3 commits into from
Sep 13, 2023
Merged

Check program input #23

merged 3 commits into from
Sep 13, 2023

Conversation

mjbverbio
Copy link
Contributor

This MR tries to check the program input before sending anything to the server with least amount of changes.


if (std::find(allowedLanguageValues.begin(), allowedLanguageValues.end(), language) == allowedLanguageValues.end())
{
throw std::runtime_error("Unsupported language value. Allowed values: en-US, en-GB, pt-BR, es, es-419, tr, ja, fr, fr-CA, de, it");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be best to use the allowedValues vector to automatically fill this string so we do not make a mistake when we add a new language

@mjbverbio mjbverbio merged commit 7364907 into main Sep 13, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants