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

Add support for AggregateError #103

Merged
merged 9 commits into from
Jan 4, 2025

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Jan 4, 2025

@fregante fregante marked this pull request as ready for review January 4, 2025 11:26
@@ -131,7 +139,9 @@ const destroyCircular = ({
for (const {property, enumerable} of errorProperties) {
if (from[property] !== undefined && from[property] !== null) {
Object.defineProperty(to, property, {
value: isErrorLike(from[property]) ? continueDestroyCircular(from[property]) : from[property],
value: isErrorLike(from[property]) || Array.isArray(from[property])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
value: isErrorLike(from[property]) || Array.isArray(from[property])
value: property === 'cause' || property === 'errors'

Copy link
Owner

Choose a reason for hiding this comment

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

This is a potentially breaking change though. And not directly related to this pull request. I would prefer it to be a separate pull request and also, cause is (unfortunately) not required to be an error. There should be a test for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it breaks when cause is not an object.

Merge as is

index.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title Add support for AggregateError Add support for AggregateError Jan 4, 2025
@sindresorhus sindresorhus merged commit b6ff2eb into sindresorhus:main Jan 4, 2025
3 checks passed
@fregante fregante deleted the aggregateerror branch January 4, 2025 17:10
@fregante
Copy link
Collaborator Author

fregante commented Jan 4, 2025

Ready to be released

alexandresoro pushed a commit to alexandresoro/ouca-backend that referenced this pull request Jan 5, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [serialize-error](https://github.com/sindresorhus/serialize-error) | dependencies | major | [`11.0.3` -> `12.0.0`](https://renovatebot.com/diffs/npm/serialize-error/11.0.3/12.0.0) |

---

### Release Notes

<details>
<summary>sindresorhus/serialize-error (serialize-error)</summary>

### [`v12.0.0`](https://github.com/sindresorhus/serialize-error/releases/tag/v12.0.0)

[Compare Source](sindresorhus/serialize-error@v11.0.3...v12.0.0)

##### Breaking

-   Require Node.js 18+ ([#&#8203;100](sindresorhus/serialize-error#100))  [`98bbe4e`](sindresorhus/serialize-error@98bbe4e)
-   Avoid breaking with bad custom constructors ([#&#8203;104](sindresorhus/serialize-error#104))  [`e593d37`](sindresorhus/serialize-error@e593d37)

##### Improvements

-   Add support for `AggregateError` ([#&#8203;103](sindresorhus/serialize-error#103))  [`b6ff2eb`](sindresorhus/serialize-error@b6ff2eb)
-   Tighten Error determination ([#&#8203;101](sindresorhus/serialize-error#101))  [`7fc2898`](sindresorhus/serialize-error@7fc2898)

##### Fixes

-   Stop making non-Error properties non-enumerable ([#&#8203;102](sindresorhus/serialize-error#102))  [`1d8395b`](sindresorhus/serialize-error@1d8395b)
-   Fix return type for `unknown` input ([#&#8203;105](sindresorhus/serialize-error#105))  [`64ce883`](sindresorhus/serialize-error@64ce883)

***

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45MC40IiwidXBkYXRlZEluVmVyIjoiMzkuOTAuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/444
Reviewed-by: Alexandre Soro <[email protected]>
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
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.

Feature request: handle AggregateErrors
2 participants