Skip to content

Conversation

@joyeecheung
Copy link
Member

src: improve error message when ICU data cannot be initialized

Previously when we fail to initialize ICU data, the error message is

could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters) 

This patch updates it to something similar to:

U_FILE_ACCESS_ERROR: Could not initialize ICU. Check the directory specified by NODE_ICU_DATA or --icu-data-dir contains icudt73l.dat and it's readable 

Where the expected data file name is the same as U_ICUDATA_NAME.

doc: improve documentation about ICU data fallback

This patch:

  • Documents --with-icu-default-data-dir and its precedence
  • Elaborates a bit more about the format of the name of the expected
    data file.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Sep 15, 2023
@joyeecheungjoyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 15, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 15, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

namespacei18n{

boolInitializeICUDirectory(const std::string& path);
boolInitializeICUDirectory(const std::string& path, std::string* error);
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, why std::string* and not const std::string&?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is an out parameter, the caller gets the error string if it fails

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
MemberAuthor

Fixed the line length to make the linter happy

@joyeecheungjoyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 18, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 18, 2023
@nodejs-github-bot
Copy link
Collaborator

Previously when we fail to initialize ICU data, the error message is ``` could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters) ``` This patch updates it to something similar to: ``` U_FILE_ACCESS_ERROR: Could not initialize ICU. Check the directory specified by NODE_ICU_DATA or --icu-data-dir contains icudt73l.dat and it's readable ``` Where the expected data file name is the same as U_ICUDATA_NAME.
This patch: - Documents `--with-icu-default-data-dir` and its precedence - Elaborates a bit more about the format of the name of the expected data file.
@joyeecheung
Copy link
MemberAuthor

Apparently test-icu-data-dir was matching the old error messages. Updated the test a bit.

@joyeecheung
Copy link
MemberAuthor

@richardlau@jasnell I've updated the test for new error message matches. Can you take a look again? Thanks

@nodejs-github-bot
Copy link
Collaborator

@joyeecheungjoyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 18, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 18, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheungjoyeecheung added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. labels Sep 22, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 22, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in c2cd744...db5e993

nodejs-github-bot pushed a commit that referenced this pull request Sep 22, 2023
Previously when we fail to initialize ICU data, the error message is ``` could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters) ``` This patch updates it to something similar to: ``` U_FILE_ACCESS_ERROR: Could not initialize ICU. Check the directory specified by NODE_ICU_DATA or --icu-data-dir contains icudt73l.dat and it's readable ``` Where the expected data file name is the same as U_ICUDATA_NAME. PR-URL: #49666 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Sep 22, 2023
This patch: - Documents `--with-icu-default-data-dir` and its precedence - Elaborates a bit more about the format of the name of the expected data file. PR-URL: #49666 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
Previously when we fail to initialize ICU data, the error message is ``` could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters) ``` This patch updates it to something similar to: ``` U_FILE_ACCESS_ERROR: Could not initialize ICU. Check the directory specified by NODE_ICU_DATA or --icu-data-dir contains icudt73l.dat and it's readable ``` Where the expected data file name is the same as U_ICUDATA_NAME. PR-URL: #49666 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
This patch: - Documents `--with-icu-default-data-dir` and its precedence - Elaborates a bit more about the format of the name of the expected data file. PR-URL: #49666 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
This was referenced Sep 28, 2023
alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
Previously when we fail to initialize ICU data, the error message is ``` could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters) ``` This patch updates it to something similar to: ``` U_FILE_ACCESS_ERROR: Could not initialize ICU. Check the directory specified by NODE_ICU_DATA or --icu-data-dir contains icudt73l.dat and it's readable ``` Where the expected data file name is the same as U_ICUDATA_NAME. PR-URL: nodejs#49666 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
This patch: - Documents `--with-icu-default-data-dir` and its precedence - Elaborates a bit more about the format of the name of the expected data file. PR-URL: nodejs#49666 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.commit-queue-rebaseAdd this label to allow the Commit Queue to land a PR in several commits.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@joyeecheung@nodejs-github-bot@jasnell@richardlau