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

Node errors for locale display names to 'unsupported' #319

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sven-oly
Copy link
Collaborator

@sven-oly sven-oly commented Oct 2, 2024

This fixes all the "error" cases in NodeJs for locale display names, moving them to "unsupported". This works for unsupported locale options and also the "root" locale.

@sven-oly
Copy link
Collaborator Author

sven-oly commented Oct 2, 2024

Fixes #318

Comment on lines +38 to +43
if (error instanceof RangeError) {
// The locale can't be handled for some reason!
outputLine["error_type"] = 'unsupported';
outputLine["unsupported"] = error.toString();
outputLine["error_detail"] = 'unsupported locale';
}
Copy link
Member

Choose a reason for hiding this comment

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

error instanceof RangeError seems a bit broad. I suggest a narrower case for returning unsupported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, there are two types of failures right now. Here's what I see being caught as exceptions:

  1. Unexpected options in the locale spec, e.g., "label":"0009","language_label":"en-u-nu-deva-t-de","locale_label":"en"

--> "RangeError: invalid_argument"

  1. "root" locale --> "RangeError: invalid_argument" in the constructor.

Should either of these be "unsupported"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think classifying these as "unsupported" is correct. This will resolve a large number of "errors" --> "unsupported", i.e.,

Report created: 2024-10-07 10:36

1,990 attempted. Pass: 1,460, Fail: 214, Errors: 316, Unsupported: 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PTAL!

@sven-oly
Copy link
Collaborator Author

sven-oly commented Oct 8, 2024

I've updated this to categorize unsupported locale options as "Unsupported". This reduces errors and failures.
image
image

I think this is worth submitting. PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants