Skip to content

build: abort download task on abnormal status code#100

Open
JLHwung wants to merge 1 commit into
node-unicode:mainfrom
JLHwung:guard-resource-fetch-status-code
Open

build: abort download task on abnormal status code#100
JLHwung wants to merge 1 commit into
node-unicode:mainfrom
JLHwung:guard-resource-fetch-status-code

Conversation

@JLHwung

@JLHwung JLHwung commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

In this PR we abort the download task when the status code is not 2XX.

This guard would be helpful if we made a typo in the resource URL or the URL has moved, and avoid issues such as 89e716d.

We also replaced when/guard to our own implementation because when/guard does not abort the download queue when we throw a synchronous error. Thus the when package has been removed.

Comment thread data/resources.js
'https://unicode.org/Public/17.0.0/emoji/emoji-zwj-sequences.txt',
// Emoji_Test (not an official property)
'emoji-test': 'https://www.unicode.org/Public/17.0.0/emoji/emoji-test.txt',
'emoji-test': 'https://unicode.org/Public/17.0.0/emoji/emoji-test.txt',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change is to avoid an extra DNS request to the www.unicode.org while we have already resolved unicode.org.

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.

1 participant