Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

chore: abort with error message #551

Merged
merged 1 commit into from
Jul 4, 2023
Merged

chore: abort with error message #551

merged 1 commit into from
Jul 4, 2023

Conversation

giulianok
Copy link
Member

Provide a general summary of your changes in the Title above.

There are NodeJS versions that do not provide a default signal.reason value, like 16.14

Description

Describe your changes in detail

This small change adds an error message when aborting a request via AbortController. Previous versions of NodeJS, like 16.14, do not provide a default signal reason, making the test fail. Newer versions, like 16.20, provide a default message.

By providing an error message we can make it work as expected in all versions that support AbortController, which are >=15

The following is an example of the failing test when running on 16.14
Screen Shot 2023-07-03 at 4 52 53 PM

The aborted property is true, but still, reason is undefined which is not what the documentation says https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/reason
Screen Shot 2023-07-03 at 6 23 57 PM

This project only accepts pull requests related to open issues.

If suggesting a new feature or change, please discuss it in an issue first.

Motivation

Why is this change required? What issue does it resolve?

Test Conditions

Describe in detail how the changes are tested.

Include details of your testing environment, and the tests you ran to.

How does your change affect the rest of the code.

Types of changes

Check boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update
  • Security update

Checklist

Check boxes that apply:

  • My code follows the code style of this project.
  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • These changes should be applied to a maintenance branch.
  • I have added the Apache 2.0 license header to any new files created.

@Matthew-Mallimo Matthew-Mallimo requested a review from a team July 4, 2023 13:32
@JAdshead JAdshead merged commit d1c6420 into main Jul 4, 2023
@JAdshead JAdshead deleted the chore/abortReason branch July 4, 2023 15:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants